Something went wrong on our end
-
Ernesto Rico Schmidt authoredErnesto Rico Schmidt authored
.gitlab-ci.yml 7.13 KiB
image: golang:1.21
stages:
- prepare
- test
- build
- deploy
- test-build
- release
variables:
GOPATH: "$CI_PROJECT_DIR/.gopath"
GOFLAGS: -mod=readonly
OPENAPI_JSON: ./public/api.json
.release-rules: &release-rules
# rule to run job on a tag-reference which has the form number.number.number (semantic versioning)
# or number.number.number-text (semantic versioning + release-name)
# and where a Dockerfile exists
- if: $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
exists:
- Dockerfile
.feature-rules: &feature-rules
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feat/ || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^fix/
exists:
- Dockerfile
cache:
paths:
- .gopath/
- ui/assets_vfsdata.go
key: default
policy: pull
prepare:
stage: prepare
cache:
policy: pull-push
script:
- mkdir -p .gopath
- export GOPATH="$CI_PROJECT_DIR/.gopath"
- go generate ./ui
- go vet ./...
rules: *feature-rules
test-all-but-store:
stage: test
script:
- go test -v -cover $(go list ./... | grep -v tank/store)
rules: *feature-rules
test-store-postgres:
stage: test
services:
- postgres:14
variables:
POSTGRES_DB: "tank"
POSTGRES_USER: "tank"
POSTGRES_PASSWORD: "aura"
AURA_TANK_TEST_DB_TYPE: "postgres"
AURA_TANK_TEST_DB_HOST: "postgres"
script:
- go run contrib/waitfor-tcp.go postgres:5432 30
- go test -v -cover ./store
rules: *feature-rules
build:
stage: build
script:
# we should actually use `make build` here, see #30