1
0
mirror of https://github.com/xorcare/testing-go-code-with-postgres.git synced 2024-12-24 16:28:34 +02:00
testing-go-code-with-postgres/.gitlab-ci.yml
Vasiliy Vasilyuk e9de025f7e
Migrate to Compose V2
From July 2023 Compose V1 stopped receiving updates. It’s also no
longer available in new releases of Docker Desktop.

Compose V2, which was first released in 2020, is included with all
currently supported versions of Docker Desktop. It offers an improved
CLI experience, improved build performance with BuildKit, and continued
new-feature development.

See https://docs.docker.com/compose/migrate
See https://docs.docker.com/compose/reference
2023-09-22 22:16:15 +03:00

50 lines
1.0 KiB
YAML

image: golang:1.20
stages:
- test
# Check that all packages are compiling.
build:
stage: test
script:
- make build
only:
- branches
# Check that all integration tests are labeled.
test-short:
stage: test
script:
- make test-short
only:
- branches
# Runs all test.
test:
services:
- docker:dind
stage: test
variables:
DOCKER_HOST: tcp://docker:2375
TESTING_DB_URL: postgresql://postgres:postgres@docker:32260/postgres?sslmode=disable
before_script:
- curl -fsSL https://get.docker.com -o install-docker.sh
- sh install-docker.sh
- docker version
- docker compose version
- make test-env-up
script:
- make test
- go get github.com/boumenot/gocover-cobertura
- go run github.com/boumenot/gocover-cobertura < coverage.out > coverage.xml
after_script:
- make test-env-down
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
coverage: '/^total:\s+\(statements\)\s+(\d+(?:\.\d+)?%)/'
only:
- branches