From 74d822aab8776e4f44534792b98f28ad739534c2 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Mon, 15 Jul 2024 11:38:20 +0200 Subject: [PATCH] ci : update gitlab ci (#955) - Only run on feature branches - Use shared cache --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ae0f7215..c78fdab22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,23 +2,39 @@ include: - project: cloud/integrations/ci file: - default.yml + - workflows/feature-branches.yml stages: + - build - test -test:acceptance: - stage: test +variables: + GOMODCACHE: $CI_PROJECT_DIR/.cache/go-mod + GOCACHE: $CI_PROJECT_DIR/.cache/go-build + +cache: + key: + files: + - go.mod + - go.sum + paths: + - $GOMODCACHE + +build: + stage: build image: golang:1.21 - except: - - tags script: - - make testacc + - go env + - go mod download -test:golangci-lint: +test:lint: stage: test - image: golangci/golangci-lint:v1.59.1 + image: golangci/golangci-lint:v1.59 script: - golangci-lint run -v - except: - - tags - - master + +test:unit: + stage: test + image: golang:1.21 + script: + - make test