From 2182e9ef16a68e315fb14a1b2da88922503d5cf3 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Sun, 19 Apr 2026 12:03:37 +0000 Subject: [PATCH 1/2] ci: cache Helm binary in CI to eliminate per-job download overhead - Added HELM_VERSION: "v3.16.4" to the workflow global environment to enable DRY key construction for caching. - Introduced actions/cache@v3 (id: helm-cache) before the "Install Helm CLI" step in the unit_tests, integration_tests, and helm jobs to cache the Helm binary and reduce per-job download overhead (~15-25 seconds per job). - Made the "Install Helm CLI" step conditional on cache misses by using steps.helm-cache.outputs.cache-hit != 'true' in all three jobs. - Removed the hardcoded HELM_VERSION from the install script; it now relies on the HELM_VERSION environment variable. - Preserved checksum verification on cache miss to maintain integrity of the cached binary. ISSUES CLOSED: #10033 --- .forgejo/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 43c512e68..73ce32016 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -10,6 +10,7 @@ env: UV_VERSION: "0.8.0" PYTHON_VERSION: "3.13" NOX_DEFAULT_VENV_BACKEND: "uv" + HELM_VERSION: "v3.16.4" # Logging policy (server-load reduction): # The Forgejo server stores every line a step streams to its console as the @@ -217,9 +218,16 @@ jobs: run: | apt-get update -qq && apt-get install -y -qq nodejs git curl tar && rm -rf /var/lib/apt/lists/* + - name: Cache Helm binary + uses: actions/cache@v3 + id: helm-cache + with: + path: /usr/local/bin/helm + key: helm-${{ env.HELM_VERSION }}-linux-amd64 + - name: Install Helm CLI + if: steps.helm-cache.outputs.cache-hit != 'true' run: | - HELM_VERSION="v3.16.4" ARCH="amd64" HELM_TARBALL="helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" curl -fsSL "https://get.helm.sh/${HELM_TARBALL}" -o "/tmp/${HELM_TARBALL}" @@ -228,7 +236,8 @@ jobs: tar -xzf "/tmp/${HELM_TARBALL}" -C /tmp mv /tmp/linux-${ARCH}/helm /usr/local/bin/helm chmod +x /usr/local/bin/helm - helm version --short + env: + HELM_VERSION: ${{ env.HELM_VERSION }} - uses: actions/checkout@v4 @@ -280,9 +289,16 @@ jobs: run: | apt-get update -qq && apt-get install -y -qq nodejs git curl tar && rm -rf /var/lib/apt/lists/* + - name: Cache Helm binary + uses: actions/cache@v3 + id: helm-cache + with: + path: /usr/local/bin/helm + key: helm-${{ env.HELM_VERSION }}-linux-amd64 + - name: Install Helm CLI + if: steps.helm-cache.outputs.cache-hit != 'true' run: | - HELM_VERSION="v3.16.4" ARCH="amd64" HELM_TARBALL="helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" curl -fsSL "https://get.helm.sh/${HELM_TARBALL}" -o "/tmp/${HELM_TARBALL}" @@ -291,7 +307,8 @@ jobs: tar -xzf "/tmp/${HELM_TARBALL}" -C /tmp mv /tmp/linux-${ARCH}/helm /usr/local/bin/helm chmod +x /usr/local/bin/helm - helm version --short + env: + HELM_VERSION: ${{ env.HELM_VERSION }} - uses: actions/checkout@v4 @@ -563,9 +580,16 @@ jobs: - uses: actions/checkout@v4 + - name: Cache Helm binary + uses: actions/cache@v3 + id: helm-cache + with: + path: /usr/local/bin/helm + key: helm-${{ env.HELM_VERSION }}-linux-amd64 + - name: Install Helm CLI + if: steps.helm-cache.outputs.cache-hit != 'true' run: | - HELM_VERSION="v3.16.4" ARCH="amd64" HELM_TARBALL="helm-${HELM_VERSION}-linux-${ARCH}.tar.gz" curl -fsSL "https://get.helm.sh/${HELM_TARBALL}" -o "/tmp/${HELM_TARBALL}" @@ -574,7 +598,8 @@ jobs: tar -xzf "/tmp/${HELM_TARBALL}" -C /tmp mv /tmp/linux-${ARCH}/helm /usr/local/bin/helm chmod +x /usr/local/bin/helm - helm version --short + env: + HELM_VERSION: ${{ env.HELM_VERSION }} - name: Install kubeconform run: | -- 2.52.0 From 8f702b5213892a4fdc768f1681366fc9d4e429a8 Mon Sep 17 00:00:00 2001 From: HAL9000 Date: Sat, 9 May 2026 02:36:38 +0000 Subject: [PATCH 2/2] ci(pr-fix-10758): add restore-keys to Helm cache steps per reviewer feedback Address PR review suggestions: - Added restore-keys fallback for Helm cache in all 3 jobs (unit_tests, integration_tests, helm) enabling graceful version migration on cache miss. --- .forgejo/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 73ce32016..4bdf2a175 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -224,6 +224,8 @@ jobs: with: path: /usr/local/bin/helm key: helm-${{ env.HELM_VERSION }}-linux-amd64 + restore-keys: | + helm- - name: Install Helm CLI if: steps.helm-cache.outputs.cache-hit != 'true' @@ -295,6 +297,8 @@ jobs: with: path: /usr/local/bin/helm key: helm-${{ env.HELM_VERSION }}-linux-amd64 + restore-keys: | + helm- - name: Install Helm CLI if: steps.helm-cache.outputs.cache-hit != 'true' @@ -586,6 +590,8 @@ jobs: with: path: /usr/local/bin/helm key: helm-${{ env.HELM_VERSION }}-linux-amd64 + restore-keys: | + helm- - name: Install Helm CLI if: steps.helm-cache.outputs.cache-hit != 'true' -- 2.52.0