mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-30 11:23:56 -05:00
b570eca0b9
(cherry picked from commitc2a7aaeee8
) (cherry picked from commit6b6007fbce
) (cherry picked from commit63608a221e
) (cherry picked from commit5cfe60baa7
) (cherry picked from commit2af4c73d12
) (cherry picked from commit1985959bfe
) (cherry picked from commit880424c77e
) (cherry picked from commitc78a861d1b
) (cherry picked from commit25c1227011
) (cherry picked from commit7195e894ee
) (cherry picked from commitcf15153873
) (cherry picked from commit9bee773c95
) (cherry picked from commit581c3060da
) (cherry picked from commitbf550f9b2c
)
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
|