forked from NYANDEV/forgejo
1d7d8f4565
(cherry picked from commit c2a7aaeee82293793b2740251dc5fd27dfb32ddb)
(cherry picked from commit 4277bdb7414885ef87a4c72fa73c088caa7cc5f1)
(cherry picked from commit adebc446711af1342671a75570edc69c73a480e9)
(cherry picked from commit 9a7332c2be588884056e34aa301f37967f33c0f2)
(cherry picked from commit cf5e3b046c
)
(cherry picked from commit eec15a625e621e2e884c8740815881a54fae20fb)
75 lines
1.8 KiB
YAML
75 lines
1.8 KiB
YAML
platform: linux/amd64
|
|
|
|
when:
|
|
event: [ push, pull_request, manual ]
|
|
branch:
|
|
exclude: [ soft-fork/*/*, soft-fork/*/*/* ]
|
|
|
|
variables:
|
|
- &golang_image 'golang:1.20'
|
|
- &test_image 'codeberg.org/forgejo/test_env:main'
|
|
- &goproxy_override ''
|
|
- &goproxy_setup |-
|
|
if [ -n "$${GOPROXY_OVERRIDE:-}" ]; then
|
|
export GOPROXY="$${GOPROXY_OVERRIDE}";
|
|
echo "Using goproxy from goproxy_override \"$${GOPROXY}\"";
|
|
elif [ -n "$${GOPROXY_DEFAULT:-}" ]; then
|
|
export GOPROXY="$${GOPROXY_DEFAULT}";
|
|
echo "Using goproxy from goproxy_default (secret) not displaying";
|
|
else
|
|
export GOPROXY="https://proxy.golang.org,direct";
|
|
echo "No goproxy overrides or defaults given, using \"$${GOPROXY}\"";
|
|
fi
|
|
|
|
workspace:
|
|
base: /go
|
|
path: src/codeberg/gitea
|
|
|
|
pipeline:
|
|
deps-backend:
|
|
image: *golang_image
|
|
pull: true
|
|
environment:
|
|
GOPROXY_OVERRIDE: *goproxy_override
|
|
secrets:
|
|
- goproxy_default
|
|
commands:
|
|
- *goproxy_setup
|
|
- make deps-backend
|
|
|
|
security-check:
|
|
image: *golang_image
|
|
group: checks
|
|
pull: true
|
|
environment:
|
|
GOPROXY_OVERRIDE: *goproxy_override
|
|
secrets:
|
|
- goproxy_default
|
|
commands:
|
|
- *goproxy_setup
|
|
- make security-check
|
|
|
|
lint-backend:
|
|
image: *test_image
|
|
pull: true
|
|
group: checks
|
|
environment:
|
|
GOPROXY_OVERRIDE: *goproxy_override
|
|
TAGS: 'bindata sqlite sqlite_unlock_notify'
|
|
GOSUMDB: 'sum.golang.org'
|
|
secrets:
|
|
- goproxy_default
|
|
commands:
|
|
- *goproxy_setup
|
|
- make lint-backend
|
|
|
|
checks-backend:
|
|
image: *test_image
|
|
group: checks
|
|
environment:
|
|
GOPROXY_OVERRIDE: *goproxy_override
|
|
secrets:
|
|
- goproxy_default
|
|
commands:
|
|
- *goproxy_setup
|
|
- make --always-make checks-backend
|