Skip to content

Commit

Permalink
ci: update gitlab ci config (#661)
Browse files Browse the repository at this point in the history
- Cleanup outdated CI jobs.
- Only run on feature branches.
  • Loading branch information
jooola authored Jul 15, 2024
1 parent 6ff536f commit c8837fb
Showing 1 changed file with 32 additions and 22 deletions.
54 changes: 32 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
---
include:
- project: cloud/operations/ci
file: k8s/release.yml
- project: cloud/integrations/ci
file:
- default.yml

stages:
- test
- e2e-test
- build
- release
- workflows/feature-branches.yml

variables:
GOPROXY: goproxy.prodext.hcinfra.de
GONOSUMDB: hetzner.cloud
GOMODCACHE: $CI_PROJECT_DIR/.cache/go-mod
GOCACHE: $CI_PROJECT_DIR/.cache/go-build

cache:
key:
files:
- go.mod
- go.sum
paths:
- $GOMODCACHE

unit:
build:
stage: build
image: golang:1.22
script:
- go env
- go mod download

test:lint:
stage: test
image: golangci/golangci-lint:v1.59
script:
- go test $(go list ./... | grep -v e2etests | grep -v integrationtests) -v
- golangci-lint run -v

e2e:
image: docker:git
stage: e2e-test
parallel:
matrix:
- K8S_VERSION: [k8s-1.23.15, k8s-1.24.9, k8s-1.25.5, k8s-1.26.0]
before_script:
- apk add --no-cache git make musl-dev go
test:unit:
stage: test
image: golang:1.22
script:
- go test $(go list ./... | grep e2etests) -v -timeout 60m
- go test -v -coverprofile=coverage.txt -covermode count ./...
- go get github.com/boumenot/gocover-cobertura
- go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
coverage: "/coverage: \\d+.\\d+% of statements/"

0 comments on commit c8837fb

Please sign in to comment.