golang-lib/.woodpecker.yml

33 lines
1.4 KiB
YAML

services:
database:
image: cockroachdb/cockroach:latest
commands:
- cockroach start-single-node --insecure
pipeline:
lint:
image: golang:latest
group: test
commands:
- apt update
- apt install python3 --yes
- ./.ci/check-testfiles
- ./.ci/check-gofmt
- go install github.com/client9/misspell/cmd/misspell@latest
- misspell -error .
test-coverage:
image: golang:latest
group: test
commands:
- go get -d -t ./...
- go test -ldflags "-X dev.sum7.eu/genofire/golang-lib/web.TestRunTLS=false -X dev.sum7.eu/genofire/golang-lib/web/webtest.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable -X dev.sum7.eu/genofire/golang-lib/database.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable" $(go list ./... | grep -v /vendor/) -v -failfast -p 1 -coverprofile .testCoverage.txt
- go tool cover -func=".testCoverage.txt"
test-race:
image: golang:latest
group: test-race
commands:
- go get -d -t ./...
- go test -ldflags "-X dev.sum7.eu/genofire/golang-lib/web.TestRunTLS=false -X dev.sum7.eu/genofire/golang-lib/web/webtest.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable -X dev.sum7.eu/genofire/golang-lib/database.DBConnection=postgres://root:root@database:26257/defaultdb?sslmode=disable" $(go list ./... | grep -v /vendor/) -race