- github.com/k3a/html2text: v1.3.0 -> v1.4.0 - github.com/tdewolff/minify/v2: v2.24.9 -> v2.24.10 - github.com/yuin/goldmark: v1.7.16 -> v1.7.17 - modernc.org/sqlite: v1.46.1 -> v1.47.0 - github.com/go-swagger/go-swagger: v0.33.1 -> v0.33.2 - github.com/google/go-cmp: v0.7.0 -> v0.7.0 - github.com/minio/minio-go/v7: v7.0.98 -> v7.0.99 - go.opentelemetry.io/contrib/exporters/autoexport: v0.65.0 -> v0.67.0 - go.opentelemetry.io/contrib/instrumentation/runtime: v0.65.0 -> v0.67.0 - golang.org/x/image: v0.36.0 -> v0.37.0 - golang.org/x/oauth2: v0.35.0 -> v0.36.0 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4773 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
138 lines
4.7 KiB
YAML
138 lines
4.7 KiB
YAML
# https://woodpecker-ci.org/docs/usage/workflow-syntax#when---global-workflow-conditions
|
|
when:
|
|
- event: pull_request
|
|
|
|
steps:
|
|
# Lint the Go code only if
|
|
# some Go files have changed.
|
|
#
|
|
# CI_PIPELINE_FILES is undefined if
|
|
# files changed > 500, and empty on
|
|
# force pushes, so account for this
|
|
# and run step to be safe.
|
|
lint:
|
|
when:
|
|
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
|
|
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
|
|
- evaluate: >-
|
|
(not ("CI_PIPELINE_FILES" in $env)) ||
|
|
CI_PIPELINE_FILES == "[]" ||
|
|
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "internal/" || # startsWith "cmd/" || # startsWith "testrig/" }) ||
|
|
len(fromJSON(CI_PIPELINE_FILES)) == 0
|
|
|
|
# We use golangci-lint for linting.
|
|
# See: https://golangci-lint.run/
|
|
image: golangci/golangci-lint:v2.9
|
|
pull: true
|
|
|
|
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#run-user
|
|
backend_options:
|
|
docker:
|
|
user: 1000:1000
|
|
|
|
# https://woodpecker-ci.org/docs/usage/volumes
|
|
volumes:
|
|
- /woodpecker/gotosocial/go-build-cache:/.cache/go-build
|
|
- /woodpecker/gotosocial/go-pkg-cache:/go/pkg
|
|
- /woodpecker/gotosocial/golangci-lint-cache:/.cache/golangci-lint
|
|
|
|
# https://woodpecker-ci.org/docs/usage/environment
|
|
environment:
|
|
GOFLAGS: "-buildvcs=false"
|
|
|
|
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
|
|
commands:
|
|
- golangci-lint run
|
|
|
|
# Test the Go code only if
|
|
# some Go files have changed.
|
|
#
|
|
# CI_PIPELINE_FILES is undefined if
|
|
# files changed > 500, and empty on
|
|
# force pushes, so account for this
|
|
# and run step to be safe.
|
|
test:
|
|
when:
|
|
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
|
|
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
|
|
- evaluate: >-
|
|
(not ("CI_PIPELINE_FILES" in $env)) ||
|
|
CI_PIPELINE_FILES == "[]" ||
|
|
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "internal/" || # startsWith "cmd/" || # startsWith "testrig/" || # startsWith "vendor/" }) ||
|
|
len(fromJSON(CI_PIPELINE_FILES)) == 0
|
|
|
|
image: golang:1.25-alpine
|
|
pull: true
|
|
|
|
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#run-user
|
|
backend_options:
|
|
docker:
|
|
user: 1000:1000
|
|
|
|
# https://woodpecker-ci.org/docs/usage/volumes
|
|
volumes:
|
|
- /woodpecker/gotosocial/go-build-cache:/.cache/go-build
|
|
- /woodpecker/gotosocial/go-pkg-cache:/go/pkg
|
|
- /woodpecker/gotosocial/wazero-compilation-cache:/.cache/wazero
|
|
- /woodpecker/gotosocial/test-tmp:/tmp
|
|
|
|
# https://woodpecker-ci.org/docs/usage/environment
|
|
environment:
|
|
CGO_ENABLED: "0"
|
|
GTS_WAZERO_COMPILATION_CACHE: "/.cache/wazero"
|
|
|
|
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
|
|
commands:
|
|
- >-
|
|
go test
|
|
-ldflags="-s -w -extldflags '-static'"
|
|
-tags="netgo osusergo static_build kvformat timetzdata"
|
|
-failfast
|
|
-timeout=30m
|
|
./...
|
|
- ./test/envparsing.sh
|
|
- ./test/swagger.sh
|
|
|
|
# Validate the web code only
|
|
# if web source has changed.
|
|
#
|
|
# CI_PIPELINE_FILES is undefined if
|
|
# files changed > 500, and empty on
|
|
# force pushes, so account for this
|
|
# and run step to be safe.
|
|
web:
|
|
when:
|
|
# https://woodpecker-ci.org/docs/usage/workflow-syntax#evaluate
|
|
# https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
|
|
- evaluate: >-
|
|
(not ("CI_PIPELINE_FILES" in $env)) ||
|
|
CI_PIPELINE_FILES == "[]" ||
|
|
any(fromJSON(CI_PIPELINE_FILES), { # startsWith "web/source/" }) ||
|
|
len(fromJSON(CI_PIPELINE_FILES)) == 0
|
|
|
|
image: node:lts-alpine
|
|
pull: true
|
|
|
|
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#run-user
|
|
backend_options:
|
|
docker:
|
|
user: 1000:1000
|
|
|
|
# https://woodpecker-ci.org/docs/usage/volumes
|
|
volumes:
|
|
- /woodpecker/gotosocial/node_modules:/woodpecker/src/codeberg.org/superseriousbusiness/gotosocial/web/source/node_modules
|
|
- /woodpecker/gotosocial/yarn-cache:/.cache/yarn
|
|
- /woodpecker/gotosocial/web-dist-test:/woodpecker/src/codeberg.org/superseriousbusiness/gotosocial/web/assets/dist
|
|
|
|
# https://woodpecker-ci.org/docs/usage/workflow-syntax#commands
|
|
commands:
|
|
# Install web dependencies.
|
|
- yarn --cwd ./web/source install --frozen-lockfile --cache-folder /.cache/yarn
|
|
- yarn --cwd ./web/source ts-patch install # https://typia.io/docs/setup/#manual-setup
|
|
|
|
# Lint web source.
|
|
- yarn --cwd ./web/source lint
|
|
|
|
# Ensure build works.
|
|
- yarn --cwd ./web/source build
|