From a1ac76232f6fae826e5b8a8e8c5e06098efd6a15 Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 20:59:10 +0200 Subject: [PATCH 1/9] ci: cache dependencies and test binaries --- .github/workflows/cache-dependencies.yml | 82 ++++++++++++++++++++++++ .github/workflows/lint-helm.yml | 7 ++ .github/workflows/lint.yml | 1 + .github/workflows/release.yml | 1 + .github/workflows/test-e2e-helm.yml | 22 +++++-- .github/workflows/test-e2e.yml | 24 +++++-- .github/workflows/test-helm-unittest.yml | 20 +++++- .github/workflows/test-helm.yml | 7 ++ .github/workflows/test.yml | 7 ++ hack/install-kind.sh | 40 ++++++++++++ 10 files changed, 200 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/cache-dependencies.yml create mode 100755 hack/install-kind.sh diff --git a/.github/workflows/cache-dependencies.yml b/.github/workflows/cache-dependencies.yml new file mode 100644 index 0000000..6820a23 --- /dev/null +++ b/.github/workflows/cache-dependencies.yml @@ -0,0 +1,82 @@ +name: Cache CI dependencies + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - main + paths: + - 'go.mod' + - 'go.sum' + - 'Makefile' + - 'charts/lifecycle-controller/.Version' + - 'hack/install-kind.sh' + - '.github/workflows/cache-dependencies.yml' + workflow_dispatch: + +permissions: {} + +env: + KIND_VERSION: v0.32.0 + HELM_CHART_PATH: charts/lifecycle-controller + HELM_UNITTEST_VERSION: v1.1.1 + +jobs: + cache: + if: github.ref == 'refs/heads/main' + permissions: + contents: read + name: Cache Go tools, kind, and Helm plugins + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + + - name: Cache Go tools and envtest assets + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: bin + key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} + + - name: Download Go modules + run: go mod download + + - name: Build Go tools and envtest assets + run: make kustomize controller-gen setup-envtest + + - name: Read Helm version from .Version + id: get-helm-version + run: echo "version=$(head "$HELM_CHART_PATH/.Version")" >> "$GITHUB_OUTPUT" + + - uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5 + with: + version: ${{ steps.get-helm-version.outputs.version }} + + - name: Cache Helm unittest plugin + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.local/share/helm/plugins/helm-unittest + key: helm-plugin-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-helm-version.outputs.version }}-${{ env.HELM_UNITTEST_VERSION }} + + - name: Install Helm unittest plugin + run: | + if [ ! -d "$(helm env HELM_PLUGINS)/helm-unittest" ]; then + helm plugin install https://github.com/helm-unittest/helm-unittest \ + --version "$HELM_UNITTEST_VERSION" --verify=false + fi + + - name: Cache kind + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.cache/kind + key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} + + - name: Install kind + run: hack/install-kind.sh diff --git a/.github/workflows/lint-helm.yml b/.github/workflows/lint-helm.yml index 914481b..3050495 100644 --- a/.github/workflows/lint-helm.yml +++ b/.github/workflows/lint-helm.yml @@ -9,6 +9,8 @@ on: paths: - 'charts/**' - 'Makefile' + - 'go.mod' + - 'go.sum' - '.github/workflows/lint-helm.yml' permissions: {} @@ -27,6 +29,11 @@ jobs: with: persist-credentials: false + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + - name: Read Helm version from .Version id: get-helm-version run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd3e702..5a4b5a3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,6 +29,7 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod + cache-dependency-path: go.sum - run: go version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a959cea..dd8a484 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,7 @@ jobs: with: cache: false go-version-file: go.mod + cache-dependency-path: go.sum - run: go version diff --git a/.github/workflows/test-e2e-helm.yml b/.github/workflows/test-e2e-helm.yml index a6afd1c..bd1ceed 100644 --- a/.github/workflows/test-e2e-helm.yml +++ b/.github/workflows/test-e2e-helm.yml @@ -10,6 +10,7 @@ on: - 'charts/**' - 'test/e2e-helm/**' - 'Makefile' + - 'hack/install-kind.sh' - 'go.mod' - 'go.sum' - '.github/workflows/test-e2e-helm.yml' @@ -18,6 +19,7 @@ permissions: {} env: HELM_CHART_PATH: charts/lifecycle-controller + KIND_VERSION: v0.32.0 jobs: test-e2e-helm: @@ -33,6 +35,19 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod + cache-dependency-path: go.sum + + - name: Restore Go tools and envtest assets + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: bin + key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} + + - name: Restore kind + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.cache/kind + key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - run: go version @@ -47,11 +62,8 @@ jobs: - run: helm version - - name: Install latest kind release - run: | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + - name: Install kind + run: hack/install-kind.sh - name: Run Helm E2E tests run: | diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 0e55dab..ae4d2fd 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -15,6 +15,7 @@ on: - 'api/**' - 'Dockerfile' - 'Makefile' + - 'hack/install-kind.sh' - 'config/**' - 'test/e2e/**' - 'test/utils/**' @@ -22,6 +23,9 @@ on: permissions: {} +env: + KIND_VERSION: v0.32.0 + jobs: test-e2e: permissions: @@ -36,14 +40,24 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod + cache-dependency-path: go.sum + + - name: Restore Go tools and envtest assets + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: bin + key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} + + - name: Restore kind + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.cache/kind + key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - run: go version - - name: Install latest kind release - run: | - curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind + - name: Install kind + run: hack/install-kind.sh - name: Verify kind installation run: kind version diff --git a/.github/workflows/test-helm-unittest.yml b/.github/workflows/test-helm-unittest.yml index 7e17c57..18eecaa 100644 --- a/.github/workflows/test-helm-unittest.yml +++ b/.github/workflows/test-helm-unittest.yml @@ -9,12 +9,15 @@ on: paths: - 'charts/**' - 'Makefile' + - 'go.mod' + - 'go.sum' - '.github/workflows/test-helm-unittest.yml' permissions: {} env: HELM_CHART_PATH: charts/lifecycle-controller + HELM_UNITTEST_VERSION: v1.1.1 jobs: helm-unittest: @@ -27,6 +30,11 @@ jobs: with: persist-credentials: false + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + - name: Read Helm version from .Version id: get-helm-version run: | @@ -38,8 +46,18 @@ jobs: - run: helm version + - name: Restore Helm unittest plugin + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.local/share/helm/plugins/helm-unittest + key: helm-plugin-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-helm-version.outputs.version }}-${{ env.HELM_UNITTEST_VERSION }} + - name: Install helm-unittest plugin - run: helm plugin install https://github.com/helm-unittest/helm-unittest --verify=false + run: | + if [ ! -d "$(helm env HELM_PLUGINS)/helm-unittest" ]; then + helm plugin install https://github.com/helm-unittest/helm-unittest \ + --version "$HELM_UNITTEST_VERSION" --verify=false + fi - name: Run Helm unit tests run: make helm-unittest HELM_CHART_PATH=${{ env.HELM_CHART_PATH }} diff --git a/.github/workflows/test-helm.yml b/.github/workflows/test-helm.yml index a64a855..1b7a9cd 100644 --- a/.github/workflows/test-helm.yml +++ b/.github/workflows/test-helm.yml @@ -9,6 +9,8 @@ on: paths: - 'charts/**' - 'Makefile' + - 'go.mod' + - 'go.sum' - '.github/workflows/test-helm.yml' permissions: {} @@ -27,6 +29,11 @@ jobs: with: persist-credentials: false + - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + - name: Read Helm version from .Version id: get-helm-version run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6f8654..c519d61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,13 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod + cache-dependency-path: go.sum + + - name: Restore Go tools and envtest assets + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: bin + key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} - run: go version diff --git a/hack/install-kind.sh b/hack/install-kind.sh new file mode 100755 index 0000000..22d0ade --- /dev/null +++ b/hack/install-kind.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +: "${KIND_VERSION:?KIND_VERSION must be set}" +: "${GITHUB_PATH:?GITHUB_PATH must be set}" + +bin_dir="$HOME/.local/bin" + +case "${RUNNER_ARCH:-X64}" in + X64) kind_arch=amd64 ;; + ARM64) kind_arch=arm64 ;; + *) + echo "Unsupported runner architecture: ${RUNNER_ARCH:-unknown}" >&2 + exit 1 + ;; +esac + +cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/kind/${KIND_VERSION}-${kind_arch}" +kind_filename="kind-linux-${kind_arch}" +kind_path="$cache_dir/$kind_filename" +checksum_path="$cache_dir/$kind_filename.sha256sum" +kind_url="https://kind.sigs.k8s.io/dl/${KIND_VERSION}/${kind_filename}" + +mkdir -p "$cache_dir" "$bin_dir" + +if [[ ! -x "$kind_path" || ! -f "$checksum_path" ]]; then + curl --fail --location --silent --show-error \ + --output "$kind_path" \ + "$kind_url" + curl --fail --location --silent --show-error \ + --output "$checksum_path" \ + "${kind_url}.sha256sum" + chmod +x "$kind_path" +fi + +(cd "$cache_dir" && sha256sum --check "$(basename "$checksum_path")") + +ln -sfn "$kind_path" "$bin_dir/kind" +echo "$bin_dir" >> "$GITHUB_PATH" From 89394bda4da8d97ff35474fa8b263f6aaa9be917 Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 21:14:50 +0200 Subject: [PATCH 2/9] ci: populate envtest cache --- .github/workflows/cache-dependencies.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cache-dependencies.yml b/.github/workflows/cache-dependencies.yml index 6820a23..e4a7723 100644 --- a/.github/workflows/cache-dependencies.yml +++ b/.github/workflows/cache-dependencies.yml @@ -48,8 +48,13 @@ jobs: - name: Download Go modules run: go mod download - - name: Build Go tools and envtest assets - run: make kustomize controller-gen setup-envtest + - name: Build Go tools + run: make kustomize controller-gen envtest + + - name: Download envtest assets + run: | + envtest_version="$(go list -m -f '{{ .Version }}' k8s.io/api | awk -F'[v.]' '{printf "1.%d", $3}')" + bin/setup-envtest use "$envtest_version" --bin-dir bin -p path - name: Read Helm version from .Version id: get-helm-version From ffd10897a7729e4029d630a3c13f15c7660919dc Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 21:20:09 +0200 Subject: [PATCH 3/9] ci: disable cache workflow checkout credentials --- .github/workflows/cache-dependencies.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cache-dependencies.yml b/.github/workflows/cache-dependencies.yml index e4a7723..13b3d41 100644 --- a/.github/workflows/cache-dependencies.yml +++ b/.github/workflows/cache-dependencies.yml @@ -33,6 +33,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: From bc7577f68380e720931acf89d996f3e0a4304a47 Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 21:32:33 +0200 Subject: [PATCH 4/9] ci: isolate Go cache writer --- .github/workflows/cache-dependencies.yml | 10 +++++++++- .github/workflows/lint-helm.yml | 10 +++++++++- .github/workflows/lint.yml | 10 +++++++++- .github/workflows/release.yml | 9 ++++++++- .github/workflows/test-e2e-helm.yml | 10 +++++++++- .github/workflows/test-e2e.yml | 10 +++++++++- .github/workflows/test-helm-unittest.yml | 10 +++++++++- .github/workflows/test-helm.yml | 10 +++++++++- .github/workflows/test.yml | 10 +++++++++- hack/install-kind.sh | 21 +++++++++++++++------ 10 files changed, 95 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cache-dependencies.yml b/.github/workflows/cache-dependencies.yml index 13b3d41..cf4f729 100644 --- a/.github/workflows/cache-dependencies.yml +++ b/.github/workflows/cache-dependencies.yml @@ -38,8 +38,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Cache Go modules and build cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Cache Go tools and envtest assets uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 diff --git a/.github/workflows/lint-helm.yml b/.github/workflows/lint-helm.yml index 3050495..a588a1f 100644 --- a/.github/workflows/lint-helm.yml +++ b/.github/workflows/lint-helm.yml @@ -31,8 +31,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Read Helm version from .Version id: get-helm-version diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a4b5a3..91877e9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,8 +28,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - run: go version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd8a484..764499a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,14 @@ jobs: with: cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - run: go version diff --git a/.github/workflows/test-e2e-helm.yml b/.github/workflows/test-e2e-helm.yml index bd1ceed..c853f56 100644 --- a/.github/workflows/test-e2e-helm.yml +++ b/.github/workflows/test-e2e-helm.yml @@ -34,8 +34,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Restore Go tools and envtest assets uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index ae4d2fd..65853de 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -39,8 +39,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Restore Go tools and envtest assets uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 diff --git a/.github/workflows/test-helm-unittest.yml b/.github/workflows/test-helm-unittest.yml index 18eecaa..e3f8444 100644 --- a/.github/workflows/test-helm-unittest.yml +++ b/.github/workflows/test-helm-unittest.yml @@ -32,8 +32,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Read Helm version from .Version id: get-helm-version diff --git a/.github/workflows/test-helm.yml b/.github/workflows/test-helm.yml index 1b7a9cd..414d6c0 100644 --- a/.github/workflows/test-helm.yml +++ b/.github/workflows/test-helm.yml @@ -31,8 +31,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Read Helm version from .Version id: get-helm-version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c519d61..b011207 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,8 +27,16 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: + cache: false go-version-file: go.mod - cache-dependency-path: go.sum + + - name: Restore Go modules and build cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - name: Restore Go tools and envtest assets uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 diff --git a/hack/install-kind.sh b/hack/install-kind.sh index 22d0ade..10c23aa 100755 --- a/hack/install-kind.sh +++ b/hack/install-kind.sh @@ -19,22 +19,31 @@ esac cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/kind/${KIND_VERSION}-${kind_arch}" kind_filename="kind-linux-${kind_arch}" kind_path="$cache_dir/$kind_filename" -checksum_path="$cache_dir/$kind_filename.sha256sum" kind_url="https://kind.sigs.k8s.io/dl/${KIND_VERSION}/${kind_filename}" +case "${KIND_VERSION}:${kind_arch}" in + v0.32.0:amd64) expected_sha256=50030de23cf40a18505f20426f6a8506bedf13c6e509244bd1fa9463721b0f54 ;; + v0.32.0:arm64) expected_sha256=b92cd615e97585de8ddade28ed5cd7feb4248d717c233eea5b03c37298900f5d ;; + *) + echo "No pinned kind checksum for ${KIND_VERSION} (${kind_arch})" >&2 + exit 1 + ;; +esac + mkdir -p "$cache_dir" "$bin_dir" -if [[ ! -x "$kind_path" || ! -f "$checksum_path" ]]; then +if [[ ! -x "$kind_path" ]]; then curl --fail --location --silent --show-error \ --output "$kind_path" \ "$kind_url" - curl --fail --location --silent --show-error \ - --output "$checksum_path" \ - "${kind_url}.sha256sum" chmod +x "$kind_path" fi -(cd "$cache_dir" && sha256sum --check "$(basename "$checksum_path")") +actual_sha256="$(sha256sum "$kind_path" | awk '{print $1}')" +if [[ "$actual_sha256" != "$expected_sha256" ]]; then + echo "Unexpected SHA-256 for $kind_path: $actual_sha256" >&2 + exit 1 +fi ln -sfn "$kind_path" "$bin_dir/kind" echo "$bin_dir" >> "$GITHUB_PATH" From a065f780d77f8f6bcbdcd275eef3e4ab162ced5d Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 21:49:31 +0200 Subject: [PATCH 5/9] ci: warm dependency caches in main CI --- .github/workflows/cache-dependencies.yml | 97 ------------------------ .github/workflows/test-e2e.yml | 25 ++++++ .github/workflows/test-helm-unittest.yml | 17 +++++ .github/workflows/test.yml | 27 +++++++ 4 files changed, 69 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/cache-dependencies.yml diff --git a/.github/workflows/cache-dependencies.yml b/.github/workflows/cache-dependencies.yml deleted file mode 100644 index cf4f729..0000000 --- a/.github/workflows/cache-dependencies.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Cache CI dependencies - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: - - main - paths: - - 'go.mod' - - 'go.sum' - - 'Makefile' - - 'charts/lifecycle-controller/.Version' - - 'hack/install-kind.sh' - - '.github/workflows/cache-dependencies.yml' - workflow_dispatch: - -permissions: {} - -env: - KIND_VERSION: v0.32.0 - HELM_CHART_PATH: charts/lifecycle-controller - HELM_UNITTEST_VERSION: v1.1.1 - -jobs: - cache: - if: github.ref == 'refs/heads/main' - permissions: - contents: read - name: Cache Go tools, kind, and Helm plugins - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - with: - persist-credentials: false - - - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 - with: - cache: false - go-version-file: go.mod - - - name: Cache Go modules and build cache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - - name: Cache Go tools and envtest assets - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: bin - key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} - - - name: Download Go modules - run: go mod download - - - name: Build Go tools - run: make kustomize controller-gen envtest - - - name: Download envtest assets - run: | - envtest_version="$(go list -m -f '{{ .Version }}' k8s.io/api | awk -F'[v.]' '{printf "1.%d", $3}')" - bin/setup-envtest use "$envtest_version" --bin-dir bin -p path - - - name: Read Helm version from .Version - id: get-helm-version - run: echo "version=$(head "$HELM_CHART_PATH/.Version")" >> "$GITHUB_OUTPUT" - - - uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5 - with: - version: ${{ steps.get-helm-version.outputs.version }} - - - name: Cache Helm unittest plugin - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ~/.local/share/helm/plugins/helm-unittest - key: helm-plugin-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-helm-version.outputs.version }}-${{ env.HELM_UNITTEST_VERSION }} - - - name: Install Helm unittest plugin - run: | - if [ ! -d "$(helm env HELM_PLUGINS)/helm-unittest" ]; then - helm plugin install https://github.com/helm-unittest/helm-unittest \ - --version "$HELM_UNITTEST_VERSION" --verify=false - fi - - - name: Cache kind - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ~/.cache/kind - key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - - - name: Install kind - run: hack/install-kind.sh diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 65853de..d1b85a1 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -20,6 +20,23 @@ on: - 'test/e2e/**' - 'test/utils/**' - '.github/workflows/test-e2e.yml' + push: + branches: + - main + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - 'internal/**' + - 'cmd/**' + - 'api/**' + - 'Dockerfile' + - 'Makefile' + - 'hack/install-kind.sh' + - 'config/**' + - 'test/e2e/**' + - 'test/utils/**' + - '.github/workflows/test-e2e.yml' permissions: {} @@ -56,7 +73,15 @@ jobs: path: bin key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} + - name: Cache kind + if: github.event_name == 'push' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.cache/kind + key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} + - name: Restore kind + if: github.event_name == 'pull_request' uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: ~/.cache/kind diff --git a/.github/workflows/test-helm-unittest.yml b/.github/workflows/test-helm-unittest.yml index e3f8444..eb434af 100644 --- a/.github/workflows/test-helm-unittest.yml +++ b/.github/workflows/test-helm-unittest.yml @@ -12,6 +12,15 @@ on: - 'go.mod' - 'go.sum' - '.github/workflows/test-helm-unittest.yml' + push: + branches: + - main + paths: + - 'charts/**' + - 'Makefile' + - 'go.mod' + - 'go.sum' + - '.github/workflows/test-helm-unittest.yml' permissions: {} @@ -54,7 +63,15 @@ jobs: - run: helm version + - name: Cache Helm unittest plugin + if: github.event_name == 'push' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.local/share/helm/plugins/helm-unittest + key: helm-plugin-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-helm-version.outputs.version }}-${{ env.HELM_UNITTEST_VERSION }} + - name: Restore Helm unittest plugin + if: github.event_name == 'pull_request' uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: ~/.local/share/helm/plugins/helm-unittest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b011207..83339ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,15 @@ on: - 'go.mod' - 'go.sum' - '.github/workflows/test.yml' + push: + branches: + - main + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - 'Makefile' + - '.github/workflows/test.yml' permissions: {} @@ -30,7 +39,17 @@ jobs: cache: false go-version-file: go.mod + - name: Cache Go modules and build cache + if: github.event_name == 'push' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} + - name: Restore Go modules and build cache + if: github.event_name == 'pull_request' uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: | @@ -38,7 +57,15 @@ jobs: ~/.cache/go-build key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} + - name: Cache Go tools and envtest assets + if: github.event_name == 'push' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: bin + key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} + - name: Restore Go tools and envtest assets + if: github.event_name == 'pull_request' uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: bin From fea2ff73975283480e179408b142ad0fc219fb2b Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 22:01:42 +0200 Subject: [PATCH 6/9] ci: use native kind action --- .github/workflows/test-e2e-helm.yml | 10 +++--- .github/workflows/test-e2e.yml | 13 ++++---- hack/install-kind.sh | 49 ----------------------------- 3 files changed, 13 insertions(+), 59 deletions(-) delete mode 100755 hack/install-kind.sh diff --git a/.github/workflows/test-e2e-helm.yml b/.github/workflows/test-e2e-helm.yml index c853f56..22dcb85 100644 --- a/.github/workflows/test-e2e-helm.yml +++ b/.github/workflows/test-e2e-helm.yml @@ -10,7 +10,6 @@ on: - 'charts/**' - 'test/e2e-helm/**' - 'Makefile' - - 'hack/install-kind.sh' - 'go.mod' - 'go.sum' - '.github/workflows/test-e2e-helm.yml' @@ -54,7 +53,7 @@ jobs: - name: Restore kind uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: - path: ~/.cache/kind + path: ${{ runner.tool_cache }}/kind key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - run: go version @@ -70,8 +69,11 @@ jobs: - run: helm version - - name: Install kind - run: hack/install-kind.sh + - name: Set up kind + uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 + with: + install_only: true + version: ${{ env.KIND_VERSION }} - name: Run Helm E2E tests run: | diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index d1b85a1..a4b83d9 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -15,7 +15,6 @@ on: - 'api/**' - 'Dockerfile' - 'Makefile' - - 'hack/install-kind.sh' - 'config/**' - 'test/e2e/**' - 'test/utils/**' @@ -32,7 +31,6 @@ on: - 'api/**' - 'Dockerfile' - 'Makefile' - - 'hack/install-kind.sh' - 'config/**' - 'test/e2e/**' - 'test/utils/**' @@ -77,20 +75,23 @@ jobs: if: github.event_name == 'push' uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: - path: ~/.cache/kind + path: ${{ runner.tool_cache }}/kind key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - name: Restore kind if: github.event_name == 'pull_request' uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: - path: ~/.cache/kind + path: ${{ runner.tool_cache }}/kind key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - run: go version - - name: Install kind - run: hack/install-kind.sh + - name: Set up kind + uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 + with: + install_only: true + version: ${{ env.KIND_VERSION }} - name: Verify kind installation run: kind version diff --git a/hack/install-kind.sh b/hack/install-kind.sh deleted file mode 100755 index 10c23aa..0000000 --- a/hack/install-kind.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -: "${KIND_VERSION:?KIND_VERSION must be set}" -: "${GITHUB_PATH:?GITHUB_PATH must be set}" - -bin_dir="$HOME/.local/bin" - -case "${RUNNER_ARCH:-X64}" in - X64) kind_arch=amd64 ;; - ARM64) kind_arch=arm64 ;; - *) - echo "Unsupported runner architecture: ${RUNNER_ARCH:-unknown}" >&2 - exit 1 - ;; -esac - -cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/kind/${KIND_VERSION}-${kind_arch}" -kind_filename="kind-linux-${kind_arch}" -kind_path="$cache_dir/$kind_filename" -kind_url="https://kind.sigs.k8s.io/dl/${KIND_VERSION}/${kind_filename}" - -case "${KIND_VERSION}:${kind_arch}" in - v0.32.0:amd64) expected_sha256=50030de23cf40a18505f20426f6a8506bedf13c6e509244bd1fa9463721b0f54 ;; - v0.32.0:arm64) expected_sha256=b92cd615e97585de8ddade28ed5cd7feb4248d717c233eea5b03c37298900f5d ;; - *) - echo "No pinned kind checksum for ${KIND_VERSION} (${kind_arch})" >&2 - exit 1 - ;; -esac - -mkdir -p "$cache_dir" "$bin_dir" - -if [[ ! -x "$kind_path" ]]; then - curl --fail --location --silent --show-error \ - --output "$kind_path" \ - "$kind_url" - chmod +x "$kind_path" -fi - -actual_sha256="$(sha256sum "$kind_path" | awk '{print $1}')" -if [[ "$actual_sha256" != "$expected_sha256" ]]; then - echo "Unexpected SHA-256 for $kind_path: $actual_sha256" >&2 - exit 1 -fi - -ln -sfn "$kind_path" "$bin_dir/kind" -echo "$bin_dir" >> "$GITHUB_PATH" From 090a569dc0d5149aa786ecb55f6f8a2b49ecea8e Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 22:11:36 +0200 Subject: [PATCH 7/9] ci: remove Go setup from Helm-only jobs --- .github/workflows/lint-helm.yml | 15 --------------- .github/workflows/test-helm-unittest.yml | 17 ----------------- .github/workflows/test-helm.yml | 15 --------------- 3 files changed, 47 deletions(-) diff --git a/.github/workflows/lint-helm.yml b/.github/workflows/lint-helm.yml index a588a1f..914481b 100644 --- a/.github/workflows/lint-helm.yml +++ b/.github/workflows/lint-helm.yml @@ -9,8 +9,6 @@ on: paths: - 'charts/**' - 'Makefile' - - 'go.mod' - - 'go.sum' - '.github/workflows/lint-helm.yml' permissions: {} @@ -29,19 +27,6 @@ jobs: with: persist-credentials: false - - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 - with: - cache: false - go-version-file: go.mod - - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - name: Read Helm version from .Version id: get-helm-version run: | diff --git a/.github/workflows/test-helm-unittest.yml b/.github/workflows/test-helm-unittest.yml index eb434af..eddf9d8 100644 --- a/.github/workflows/test-helm-unittest.yml +++ b/.github/workflows/test-helm-unittest.yml @@ -9,8 +9,6 @@ on: paths: - 'charts/**' - 'Makefile' - - 'go.mod' - - 'go.sum' - '.github/workflows/test-helm-unittest.yml' push: branches: @@ -18,8 +16,6 @@ on: paths: - 'charts/**' - 'Makefile' - - 'go.mod' - - 'go.sum' - '.github/workflows/test-helm-unittest.yml' permissions: {} @@ -39,19 +35,6 @@ jobs: with: persist-credentials: false - - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 - with: - cache: false - go-version-file: go.mod - - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - name: Read Helm version from .Version id: get-helm-version run: | diff --git a/.github/workflows/test-helm.yml b/.github/workflows/test-helm.yml index 414d6c0..a64a855 100644 --- a/.github/workflows/test-helm.yml +++ b/.github/workflows/test-helm.yml @@ -9,8 +9,6 @@ on: paths: - 'charts/**' - 'Makefile' - - 'go.mod' - - 'go.sum' - '.github/workflows/test-helm.yml' permissions: {} @@ -29,19 +27,6 @@ jobs: with: persist-credentials: false - - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 - with: - cache: false - go-version-file: go.mod - - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - name: Read Helm version from .Version id: get-helm-version run: | From ec815d7a45620ef309524f368e97fe5303c01624 Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 22:21:58 +0200 Subject: [PATCH 8/9] ci: use native workflow caches only --- .github/workflows/lint.yml | 11 ++------ .github/workflows/release.yml | 11 ++------ .github/workflows/test-e2e-helm.yml | 23 ++-------------- .github/workflows/test-e2e.yml | 31 ++------------------- .github/workflows/test-helm-unittest.yml | 14 ---------- .github/workflows/test.yml | 35 ++---------------------- 6 files changed, 10 insertions(+), 115 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 91877e9..b9c87d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,17 +28,10 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: - cache: false + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - run: go version - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 764499a..16a9c6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,17 +26,10 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: - cache: false + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - run: go version - uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4 diff --git a/.github/workflows/test-e2e-helm.yml b/.github/workflows/test-e2e-helm.yml index 22dcb85..20fe347 100644 --- a/.github/workflows/test-e2e-helm.yml +++ b/.github/workflows/test-e2e-helm.yml @@ -33,29 +33,10 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: - cache: false + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - - name: Restore Go tools and envtest assets - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: bin - key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} - - - name: Restore kind - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ${{ runner.tool_cache }}/kind - key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - - run: go version - name: Read Helm version from .Version diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index a4b83d9..d589b3c 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -54,37 +54,10 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: - cache: false + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - - name: Restore Go modules and build cache - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - - name: Restore Go tools and envtest assets - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: bin - key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} - - - name: Cache kind - if: github.event_name == 'push' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ${{ runner.tool_cache }}/kind - key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - - - name: Restore kind - if: github.event_name == 'pull_request' - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ${{ runner.tool_cache }}/kind - key: kind-${{ runner.os }}-${{ runner.arch }}-${{ env.KIND_VERSION }} - - run: go version - name: Set up kind diff --git a/.github/workflows/test-helm-unittest.yml b/.github/workflows/test-helm-unittest.yml index eddf9d8..6f4fddc 100644 --- a/.github/workflows/test-helm-unittest.yml +++ b/.github/workflows/test-helm-unittest.yml @@ -46,20 +46,6 @@ jobs: - run: helm version - - name: Cache Helm unittest plugin - if: github.event_name == 'push' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ~/.local/share/helm/plugins/helm-unittest - key: helm-plugin-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-helm-version.outputs.version }}-${{ env.HELM_UNITTEST_VERSION }} - - - name: Restore Helm unittest plugin - if: github.event_name == 'pull_request' - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: ~/.local/share/helm/plugins/helm-unittest - key: helm-plugin-${{ runner.os }}-${{ runner.arch }}-${{ steps.get-helm-version.outputs.version }}-${{ env.HELM_UNITTEST_VERSION }} - - name: Install helm-unittest plugin run: | if [ ! -d "$(helm env HELM_PLUGINS)/helm-unittest" ]; then diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83339ff..f6d640f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,41 +36,10 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: - cache: false + cache: true + cache-dependency-path: go.sum go-version-file: go.mod - - name: Cache Go modules and build cache - if: github.event_name == 'push' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - - name: Restore Go modules and build cache - if: github.event_name == 'pull_request' - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: | - ~/go/pkg/mod - ~/.cache/go-build - key: go-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum') }} - - - name: Cache Go tools and envtest assets - if: github.event_name == 'push' - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: bin - key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} - - - name: Restore Go tools and envtest assets - if: github.event_name == 'pull_request' - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 - with: - path: bin - key: go-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('go.mod', 'go.sum', 'Makefile') }} - - run: go version - name: Run unit tests From ea1113f4401bc027bd0d873c895b78e88f65b01f Mon Sep 17 00:00:00 2001 From: Cezary Stanislawski Date: Wed, 15 Jul 2026 22:23:15 +0200 Subject: [PATCH 9/9] ci: disable release workflow Go cache --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 16a9c6b..a959cea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,8 +26,7 @@ jobs: - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: - cache: true - cache-dependency-path: go.sum + cache: false go-version-file: go.mod - run: go version