From dbde712691972d56d48c7a55cadd8785eabdad9a Mon Sep 17 00:00:00 2001 From: Filip Aleksic Date: Thu, 6 Nov 2025 09:31:54 +0100 Subject: [PATCH 1/6] chore(ci): speed up tests attempt --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d967b9656..8b768c952 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,14 +79,15 @@ include: # From: https://docs.gitlab.com/ci/caching/#cache-go-dependencies .go-cache: variables: - GOPATH: $CI_PROJECT_DIR/.go - GOLANGCI_LINT_CACHE: $CI_PROJECT_DIR/.golangci-lint + GODEBUG: gocachetest=1 + GOCACHE: $CI_PROJECT_DIR/.gocache-$CI_COMMIT_REF_PROTECTED before_script: - - mkdir -p .go .golangci-lint + - mkdir -p "$GOCACHE" + - go env GOCACHE cache: paths: - - .go/pkg/mod/ - - .golangci-lint/ + - $CI_PROJECT_DIR/.gocache-false/ + key: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" .documentation: stage: documentation -- GitLab From 8c57abd8dc0c785ba642a68eb56afc516a49de1e Mon Sep 17 00:00:00 2001 From: Filip Aleksic Date: Thu, 6 Nov 2025 09:49:17 +0100 Subject: [PATCH 2/6] chore(ci): cache deps --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b768c952..a6ae05d3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,12 +81,14 @@ include: variables: GODEBUG: gocachetest=1 GOCACHE: $CI_PROJECT_DIR/.gocache-$CI_COMMIT_REF_PROTECTED + GOPATH: $CI_PROJECT_DIR/.go before_script: - mkdir -p "$GOCACHE" - go env GOCACHE cache: paths: - $CI_PROJECT_DIR/.gocache-false/ + - .go/pkg/mod/ key: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" .documentation: -- GitLab From 3f2b2d37c5d5449bee09717e8dfe1d5570503950 Mon Sep 17 00:00:00 2001 From: Filip Aleksic Date: Thu, 6 Nov 2025 10:59:46 +0100 Subject: [PATCH 3/6] remove some testing args --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6ae05d3a..8f2944293 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,7 +79,6 @@ include: # From: https://docs.gitlab.com/ci/caching/#cache-go-dependencies .go-cache: variables: - GODEBUG: gocachetest=1 GOCACHE: $CI_PROJECT_DIR/.gocache-$CI_COMMIT_REF_PROTECTED GOPATH: $CI_PROJECT_DIR/.go before_script: @@ -89,7 +88,7 @@ include: paths: - $CI_PROJECT_DIR/.gocache-false/ - .go/pkg/mod/ - key: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" + key: "${CI_JOB_NAME}" .documentation: stage: documentation -- GitLab From c3fa464a4098fee5faa5c615f0f7631209274f73 Mon Sep 17 00:00:00 2001 From: Filip Aleksic Date: Thu, 6 Nov 2025 11:03:02 +0100 Subject: [PATCH 4/6] add linter cache --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8f2944293..d25707b03 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,6 +81,7 @@ include: variables: GOCACHE: $CI_PROJECT_DIR/.gocache-$CI_COMMIT_REF_PROTECTED GOPATH: $CI_PROJECT_DIR/.go + GOLANGCI_LINT_CACHE: $CI_PROJECT_DIR/.golangci-lint before_script: - mkdir -p "$GOCACHE" - go env GOCACHE @@ -88,6 +89,7 @@ include: paths: - $CI_PROJECT_DIR/.gocache-false/ - .go/pkg/mod/ + - $CI_PROJECT_DIR/.golangci-lint/ key: "${CI_JOB_NAME}" .documentation: -- GitLab From 157b377017304b3cf1bd9d33d3f966222cade20e Mon Sep 17 00:00:00 2001 From: Filip Aleksic Date: Thu, 6 Nov 2025 11:10:36 +0100 Subject: [PATCH 5/6] clarify .gocache-false --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d25707b03..7e6833097 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,6 +87,7 @@ include: - go env GOCACHE cache: paths: + # The .gocache-false only caches on unprotected branches - $CI_PROJECT_DIR/.gocache-false/ - .go/pkg/mod/ - $CI_PROJECT_DIR/.golangci-lint/ -- GitLab From 517ff74b1255fb5f41f539a2653709194627368e Mon Sep 17 00:00:00 2001 From: Filip Aleksic Date: Thu, 6 Nov 2025 19:07:24 +0100 Subject: [PATCH 6/6] fix(ci): improve ci further --- .gitlab-ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e6833097..e294bbcda 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,7 +89,7 @@ include: paths: # The .gocache-false only caches on unprotected branches - $CI_PROJECT_DIR/.gocache-false/ - - .go/pkg/mod/ + - $CI_PROJECT_DIR/.go/pkg/mod/ - $CI_PROJECT_DIR/.golangci-lint/ key: "${CI_JOB_NAME}" @@ -152,6 +152,7 @@ check_go_generated_code: - .go-cache - .test needs: [] + before_script: [] script: # Workaround config.yaml.lock file permissions - chmod 600 internal/config/config.yaml.lock @@ -168,6 +169,7 @@ check_go_generated_code: lint_commit: stage: test + needs: [] image: ${GITLAB_DEPENDENCY_PROXY}node:24-slim script: - apt-get update && apt-get install -y git @@ -179,14 +181,16 @@ lint_commit: when: always lint: - extends: .test + extends: + - .test + - .go-cache + needs: [] image: ${GITLAB_DEPENDENCY_PROXY}golangci/golangci-lint:v$GOLANGCI_LINT_VERSION script: # Write the code coverage report to gl-code-quality-report.json # and print linting issues to stdout in the format: path/to/file:line description # add `--issues-exit-code 0` to ignore linting issues - golangci-lint run --output.text.path=stdout --output.text.colors=false --output.text.print-issued-lines=false --output.code-climate.path=gl-code-quality-report.json - artifacts: reports: codequality: gl-code-quality-report.json -- GitLab