when: - event: [pull_request] - event: push branch: - ${CI_REPO_DEFAULT_BRANCH} services: database: image: postgres:14 pull: true environment: POSTGRES_DB: twhelp POSTGRES_PASSWORD: twhelp variables: - &go_image 'golang:1.21' steps: generate: image: *go_image pull: true commands: - make generate test: image: *go_image depends_on: - generate pull: true environment: TESTS_POSTGRES_CONNECTION_STRING: postgres://postgres:twhelp@database:5432/twhelp?sslmode=disable commands: - go test -race -coverprofile=coverage.txt -covermode=atomic ./... lint: image: golangci/golangci-lint:v1.55 pull: true depends_on: - generate commands: - golangci-lint run check-go-mod: image: *go_image depends_on: - generate pull: true commands: - go mod tidy - git diff --exit-code go.mod hadolint: image: hadolint/hadolint:2.12.0-debian commands: - hadolint build/docker/twhelp/prod/Dockerfile build/docker/twhelp/dev/Dockerfile when: - path: - build/docker/twhelp/prod/Dockerfile - build/docker/twhelp/dev/Dockerfile yamllint: image: cytopia/yamllint:1 pull: true commands: - yamllint --strict . when: - path: include: - "**/*.yaml" - "**/*.yml"