2022-06-11 21:02:06 +00:00
|
|
|
branches: main
|
|
|
|
|
2022-03-27 19:54:06 +00:00
|
|
|
pipeline:
|
|
|
|
# use vendor to cache dependencies
|
|
|
|
vendor:
|
2022-06-10 13:27:17 +00:00
|
|
|
image: golang:1.18
|
2022-03-27 19:54:06 +00:00
|
|
|
commands:
|
|
|
|
- go mod vendor
|
|
|
|
|
|
|
|
lint:
|
2022-06-11 21:17:43 +00:00
|
|
|
image: golangci/golangci-lint:latest
|
|
|
|
pull: true
|
2022-03-27 19:54:06 +00:00
|
|
|
commands:
|
|
|
|
- go version
|
|
|
|
- go install mvdan.cc/gofumpt@latest
|
|
|
|
- "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }"
|
2022-06-11 21:17:43 +00:00
|
|
|
- golangci-lint run --timeout 5m --build-tags integration
|
2022-03-27 19:54:06 +00:00
|
|
|
|
2022-03-30 19:31:09 +00:00
|
|
|
test:
|
2022-06-10 13:27:17 +00:00
|
|
|
image: golang:1.18
|
2022-03-30 19:31:09 +00:00
|
|
|
commands:
|
2022-06-11 21:17:43 +00:00
|
|
|
- go test -race codeberg.org/codeberg/pages/server/...
|
2022-03-27 19:54:06 +00:00
|
|
|
|
|
|
|
build:
|
2022-06-10 13:27:17 +00:00
|
|
|
image: golang:1.18
|
2022-03-27 19:54:06 +00:00
|
|
|
commands:
|
|
|
|
- go build
|
2022-06-11 21:17:43 +00:00
|
|
|
|
|
|
|
integration-tests:
|
|
|
|
image: golang:1.18
|
|
|
|
commands:
|
|
|
|
- go test -race -tags integration codeberg.org/codeberg/pages/integration/...
|
|
|
|
environment:
|
|
|
|
- ACME_API=https://acme.mock.directory
|
|
|
|
- PAGES_DOMAIN=localhost.mock.directory
|
|
|
|
- RAW_DOMAIN=raw.localhost.mock.directory
|
|
|
|
- PORT=4430
|