From f856a8ed17e670c090b17d7f7c6b96903c0a1560 Mon Sep 17 00:00:00 2001 From: vismishr Date: Wed, 13 May 2026 00:07:41 +0530 Subject: [PATCH 1/5] ci(workflows): extend EFS-backed build cache to lint, verify, and envtest Add conditional EFS cache warming step to lint, verify, envtest-ocp, and envtest-kube workflows. Each job copies /cache/go-build to a local tmpdir when available, falling back gracefully when the mount is absent. Part-of: CNTRLPLANE-3329 --- .github/workflows/envtest-kube-reusable.yaml | 7 +++++++ .github/workflows/envtest-ocp-reusable.yaml | 7 +++++++ .github/workflows/lint-reusable.yaml | 7 +++++++ .github/workflows/verify-reusable.yaml | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/.github/workflows/envtest-kube-reusable.yaml b/.github/workflows/envtest-kube-reusable.yaml index e38fe093c06..7921ea49387 100644 --- a/.github/workflows/envtest-kube-reusable.yaml +++ b/.github/workflows/envtest-kube-reusable.yaml @@ -49,6 +49,8 @@ jobs: if: needs.changes.outputs.should_run == 'true' runs-on: arc-runner-set timeout-minutes: 15 + env: + GOCACHE: /tmp/go-build-cache strategy: fail-fast: false matrix: @@ -57,6 +59,11 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Warm Go build cache from EFS + run: | + if [ -d /cache/go-build ]; then + cp -a /cache/go-build /tmp/go-build-cache + fi - run: make test-envtest-kube ENVTEST_KUBE_VERSIONS="${{ matrix.version }}" conclusion: diff --git a/.github/workflows/envtest-ocp-reusable.yaml b/.github/workflows/envtest-ocp-reusable.yaml index 2f001758c43..217f62abb52 100644 --- a/.github/workflows/envtest-ocp-reusable.yaml +++ b/.github/workflows/envtest-ocp-reusable.yaml @@ -49,6 +49,8 @@ jobs: if: needs.changes.outputs.should_run == 'true' runs-on: arc-runner-set timeout-minutes: 15 + env: + GOCACHE: /tmp/go-build-cache strategy: fail-fast: false matrix: @@ -58,6 +60,11 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Warm Go build cache from EFS + run: | + if [ -d /cache/go-build ]; then + cp -a /cache/go-build /tmp/go-build-cache + fi - run: make test-envtest-ocp ENVTEST_OCP_K8S_VERSIONS="${{ matrix.version }}" conclusion: diff --git a/.github/workflows/lint-reusable.yaml b/.github/workflows/lint-reusable.yaml index e969b494fa8..a417b2e341a 100644 --- a/.github/workflows/lint-reusable.yaml +++ b/.github/workflows/lint-reusable.yaml @@ -11,6 +11,8 @@ jobs: name: Lint runs-on: arc-runner-set timeout-minutes: 60 + env: + GOCACHE: /tmp/go-build-cache steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -20,6 +22,11 @@ jobs: if [ -n "${{ github.base_ref }}" ]; then git fetch origin "${{ github.base_ref }}:${{ github.base_ref }}" fi + - name: Warm Go build cache from EFS + run: | + if [ -d /cache/go-build ]; then + cp -a /cache/go-build /tmp/go-build-cache + fi - name: Use pre-built lint tools run: | if [ -d /opt/lint-tools ]; then diff --git a/.github/workflows/verify-reusable.yaml b/.github/workflows/verify-reusable.yaml index f543d537bff..ad3922bd415 100644 --- a/.github/workflows/verify-reusable.yaml +++ b/.github/workflows/verify-reusable.yaml @@ -11,10 +11,17 @@ jobs: name: Verify runs-on: arc-runner-set timeout-minutes: 60 + env: + GOCACHE: /tmp/go-build-cache steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false + - name: Warm Go build cache from EFS + run: | + if [ -d /cache/go-build ]; then + cp -a /cache/go-build /tmp/go-build-cache + fi - run: make generate update - run: make staticcheck - run: make fmt From 32746d760f25a14dad3e8cbb05c80de61e0bd096 Mon Sep 17 00:00:00 2001 From: vismishr Date: Wed, 13 May 2026 01:13:06 +0530 Subject: [PATCH 2/5] ci(workflows): copy cache contents instead of directory Use cp -a /cache/go-build/. to copy the contents of the cache directory rather than the directory itself. This prevents a nested go-build subdirectory if /tmp/go-build-cache already exists. --- .github/workflows/envtest-kube-reusable.yaml | 3 ++- .github/workflows/envtest-ocp-reusable.yaml | 3 ++- .github/workflows/lint-reusable.yaml | 3 ++- .github/workflows/verify-reusable.yaml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/envtest-kube-reusable.yaml b/.github/workflows/envtest-kube-reusable.yaml index 7921ea49387..9fd890f9ee9 100644 --- a/.github/workflows/envtest-kube-reusable.yaml +++ b/.github/workflows/envtest-kube-reusable.yaml @@ -62,7 +62,8 @@ jobs: - name: Warm Go build cache from EFS run: | if [ -d /cache/go-build ]; then - cp -a /cache/go-build /tmp/go-build-cache + mkdir -p /tmp/go-build-cache + cp -a /cache/go-build/. /tmp/go-build-cache/ fi - run: make test-envtest-kube ENVTEST_KUBE_VERSIONS="${{ matrix.version }}" diff --git a/.github/workflows/envtest-ocp-reusable.yaml b/.github/workflows/envtest-ocp-reusable.yaml index 217f62abb52..6d3bfca8a9f 100644 --- a/.github/workflows/envtest-ocp-reusable.yaml +++ b/.github/workflows/envtest-ocp-reusable.yaml @@ -63,7 +63,8 @@ jobs: - name: Warm Go build cache from EFS run: | if [ -d /cache/go-build ]; then - cp -a /cache/go-build /tmp/go-build-cache + mkdir -p /tmp/go-build-cache + cp -a /cache/go-build/. /tmp/go-build-cache/ fi - run: make test-envtest-ocp ENVTEST_OCP_K8S_VERSIONS="${{ matrix.version }}" diff --git a/.github/workflows/lint-reusable.yaml b/.github/workflows/lint-reusable.yaml index a417b2e341a..75b8220395d 100644 --- a/.github/workflows/lint-reusable.yaml +++ b/.github/workflows/lint-reusable.yaml @@ -25,7 +25,8 @@ jobs: - name: Warm Go build cache from EFS run: | if [ -d /cache/go-build ]; then - cp -a /cache/go-build /tmp/go-build-cache + mkdir -p /tmp/go-build-cache + cp -a /cache/go-build/. /tmp/go-build-cache/ fi - name: Use pre-built lint tools run: | diff --git a/.github/workflows/verify-reusable.yaml b/.github/workflows/verify-reusable.yaml index ad3922bd415..f469a2ad125 100644 --- a/.github/workflows/verify-reusable.yaml +++ b/.github/workflows/verify-reusable.yaml @@ -20,7 +20,8 @@ jobs: - name: Warm Go build cache from EFS run: | if [ -d /cache/go-build ]; then - cp -a /cache/go-build /tmp/go-build-cache + mkdir -p /tmp/go-build-cache + cp -a /cache/go-build/. /tmp/go-build-cache/ fi - run: make generate update - run: make staticcheck From e1b5176f93925a3867e1c787f739b814c9e92bcc Mon Sep 17 00:00:00 2001 From: vismishr Date: Thu, 14 May 2026 12:11:15 +0530 Subject: [PATCH 3/5] ci(workflows): extract cache warm into composite action with error handling Extract the EFS cache-warm block into a reusable composite action at .github/actions/warm-go-cache/action.yaml. This adds graceful error handling so copy failures log a warning instead of failing the job, and sets GOCACHE via GITHUB_ENV to eliminate job-level env vars. Commit-Message-Assisted-by: Claude Opus 4.6 --- .github/workflows/envtest-kube-reusable.yaml | 9 +-------- .github/workflows/envtest-ocp-reusable.yaml | 9 +-------- .github/workflows/lint-reusable.yaml | 9 +-------- .github/workflows/verify-reusable.yaml | 9 +-------- 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/.github/workflows/envtest-kube-reusable.yaml b/.github/workflows/envtest-kube-reusable.yaml index 9fd890f9ee9..7e19f51213a 100644 --- a/.github/workflows/envtest-kube-reusable.yaml +++ b/.github/workflows/envtest-kube-reusable.yaml @@ -49,8 +49,6 @@ jobs: if: needs.changes.outputs.should_run == 'true' runs-on: arc-runner-set timeout-minutes: 15 - env: - GOCACHE: /tmp/go-build-cache strategy: fail-fast: false matrix: @@ -59,12 +57,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Warm Go build cache from EFS - run: | - if [ -d /cache/go-build ]; then - mkdir -p /tmp/go-build-cache - cp -a /cache/go-build/. /tmp/go-build-cache/ - fi + - uses: ./.github/actions/warm-go-cache - run: make test-envtest-kube ENVTEST_KUBE_VERSIONS="${{ matrix.version }}" conclusion: diff --git a/.github/workflows/envtest-ocp-reusable.yaml b/.github/workflows/envtest-ocp-reusable.yaml index 6d3bfca8a9f..b44ac05c40e 100644 --- a/.github/workflows/envtest-ocp-reusable.yaml +++ b/.github/workflows/envtest-ocp-reusable.yaml @@ -49,8 +49,6 @@ jobs: if: needs.changes.outputs.should_run == 'true' runs-on: arc-runner-set timeout-minutes: 15 - env: - GOCACHE: /tmp/go-build-cache strategy: fail-fast: false matrix: @@ -60,12 +58,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Warm Go build cache from EFS - run: | - if [ -d /cache/go-build ]; then - mkdir -p /tmp/go-build-cache - cp -a /cache/go-build/. /tmp/go-build-cache/ - fi + - uses: ./.github/actions/warm-go-cache - run: make test-envtest-ocp ENVTEST_OCP_K8S_VERSIONS="${{ matrix.version }}" conclusion: diff --git a/.github/workflows/lint-reusable.yaml b/.github/workflows/lint-reusable.yaml index 75b8220395d..3efe807ff57 100644 --- a/.github/workflows/lint-reusable.yaml +++ b/.github/workflows/lint-reusable.yaml @@ -11,8 +11,6 @@ jobs: name: Lint runs-on: arc-runner-set timeout-minutes: 60 - env: - GOCACHE: /tmp/go-build-cache steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -22,12 +20,7 @@ jobs: if [ -n "${{ github.base_ref }}" ]; then git fetch origin "${{ github.base_ref }}:${{ github.base_ref }}" fi - - name: Warm Go build cache from EFS - run: | - if [ -d /cache/go-build ]; then - mkdir -p /tmp/go-build-cache - cp -a /cache/go-build/. /tmp/go-build-cache/ - fi + - uses: ./.github/actions/warm-go-cache - name: Use pre-built lint tools run: | if [ -d /opt/lint-tools ]; then diff --git a/.github/workflows/verify-reusable.yaml b/.github/workflows/verify-reusable.yaml index f469a2ad125..a9972031bfb 100644 --- a/.github/workflows/verify-reusable.yaml +++ b/.github/workflows/verify-reusable.yaml @@ -11,18 +11,11 @@ jobs: name: Verify runs-on: arc-runner-set timeout-minutes: 60 - env: - GOCACHE: /tmp/go-build-cache steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Warm Go build cache from EFS - run: | - if [ -d /cache/go-build ]; then - mkdir -p /tmp/go-build-cache - cp -a /cache/go-build/. /tmp/go-build-cache/ - fi + - uses: ./.github/actions/warm-go-cache - run: make generate update - run: make staticcheck - run: make fmt From 27d972bc1d96c03ea7ebfb3b3da0c1fd0ebb1ad2 Mon Sep 17 00:00:00 2001 From: vismishr Date: Thu, 14 May 2026 20:28:41 +0530 Subject: [PATCH 4/5] ci(workflows): add copy timeout and declare GOCACHE at job level Add timeout 120 to the EFS cache copy in the composite action to guard against stale NFS handles blocking the entire job. Restore GOCACHE in each workflow's job-level env block so the cache path is visible at a glance and safe against step reordering. Commit-Message-Assisted-by: Claude --- .github/workflows/envtest-kube-reusable.yaml | 2 ++ .github/workflows/envtest-ocp-reusable.yaml | 2 ++ .github/workflows/lint-reusable.yaml | 2 ++ .github/workflows/verify-reusable.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/envtest-kube-reusable.yaml b/.github/workflows/envtest-kube-reusable.yaml index 7e19f51213a..f3b2609d655 100644 --- a/.github/workflows/envtest-kube-reusable.yaml +++ b/.github/workflows/envtest-kube-reusable.yaml @@ -49,6 +49,8 @@ jobs: if: needs.changes.outputs.should_run == 'true' runs-on: arc-runner-set timeout-minutes: 15 + env: + GOCACHE: /tmp/go-build-cache strategy: fail-fast: false matrix: diff --git a/.github/workflows/envtest-ocp-reusable.yaml b/.github/workflows/envtest-ocp-reusable.yaml index b44ac05c40e..b487da9b74a 100644 --- a/.github/workflows/envtest-ocp-reusable.yaml +++ b/.github/workflows/envtest-ocp-reusable.yaml @@ -49,6 +49,8 @@ jobs: if: needs.changes.outputs.should_run == 'true' runs-on: arc-runner-set timeout-minutes: 15 + env: + GOCACHE: /tmp/go-build-cache strategy: fail-fast: false matrix: diff --git a/.github/workflows/lint-reusable.yaml b/.github/workflows/lint-reusable.yaml index 3efe807ff57..8784b8c2403 100644 --- a/.github/workflows/lint-reusable.yaml +++ b/.github/workflows/lint-reusable.yaml @@ -11,6 +11,8 @@ jobs: name: Lint runs-on: arc-runner-set timeout-minutes: 60 + env: + GOCACHE: /tmp/go-build-cache steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: diff --git a/.github/workflows/verify-reusable.yaml b/.github/workflows/verify-reusable.yaml index a9972031bfb..c1957a89859 100644 --- a/.github/workflows/verify-reusable.yaml +++ b/.github/workflows/verify-reusable.yaml @@ -11,6 +11,8 @@ jobs: name: Verify runs-on: arc-runner-set timeout-minutes: 60 + env: + GOCACHE: /tmp/go-build-cache steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: From 0b54080c88826de8621d36880141896f564a3938 Mon Sep 17 00:00:00 2001 From: vismishr Date: Thu, 14 May 2026 23:57:17 +0530 Subject: [PATCH 5/5] ci(workflows): use GitHub warning annotation for cache copy failures Use ::warning:: instead of plain echo so EFS cache copy failures surface in the Checks UI annotations rather than being buried in logs. Commit-Message-Assisted-by: Claude --- .github/actions/warm-go-cache/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/warm-go-cache/action.yaml b/.github/actions/warm-go-cache/action.yaml index 8b4a192314c..26b51b5ab2f 100644 --- a/.github/actions/warm-go-cache/action.yaml +++ b/.github/actions/warm-go-cache/action.yaml @@ -9,5 +9,5 @@ runs: if [ -d /cache/go-build ]; then mkdir -p /tmp/go-build-cache && \ timeout 120 cp -a /cache/go-build/. /tmp/go-build-cache/ || \ - echo "Warning: failed to copy EFS cache, proceeding without cache" + echo "::warning::Failed to copy EFS cache, proceeding without cache" fi