2022-06-10 17:42:12 +02:00
|
|
|
branches: main
|
|
|
|
|
2022-03-27 21:54:06 +02:00
|
|
|
pipeline:
|
|
|
|
# use vendor to cache dependencies
|
|
|
|
vendor:
|
2022-06-10 15:27:17 +02:00
|
|
|
image: golang:1.18
|
2022-03-27 21:54:06 +02:00
|
|
|
commands:
|
|
|
|
- go mod vendor
|
|
|
|
|
|
|
|
lint:
|
2022-06-10 18:33:03 +02:00
|
|
|
image: golangci/golangci-lint:latest
|
|
|
|
pull: true
|
2022-03-27 21:54:06 +02:00
|
|
|
commands:
|
|
|
|
- go version
|
|
|
|
- go install mvdan.cc/gofumpt@latest
|
|
|
|
- "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }"
|
2022-05-10 18:14:28 +02:00
|
|
|
- golangci-lint run --timeout 5m
|
2022-03-27 21:54:06 +02:00
|
|
|
|
2022-03-30 21:31:09 +02:00
|
|
|
test:
|
2022-06-10 15:27:17 +02:00
|
|
|
image: golang:1.18
|
2022-03-30 21:31:09 +02:00
|
|
|
commands:
|
2022-06-10 18:28:12 +02:00
|
|
|
- go test codeberg.org/codeberg/pages/server/...
|
2022-03-27 21:54:06 +02:00
|
|
|
|
|
|
|
build:
|
2022-06-10 15:27:17 +02:00
|
|
|
image: golang:1.18
|
2022-03-27 21:54:06 +02:00
|
|
|
commands:
|
|
|
|
- go build
|
2022-06-10 17:39:12 +02:00
|
|
|
|
|
|
|
integration-tests:
|
|
|
|
image: golang:1.18
|
|
|
|
detach: true
|
|
|
|
commands:
|
2022-06-10 18:28:12 +02:00
|
|
|
- go test -tags integration codeberg.org/codeberg/pages/integration/...
|