@@ -137,7 +137,7 @@ jobs:
137137 go-version : stable
138138 cache-dependency-path : |
139139 go.sum
140- .github/.cache/buster-for-vars
140+ tests/go.sum
141141
142142 - name : Check for changes
143143 uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@@ -192,7 +192,7 @@ jobs:
192192 go-version : stable
193193 cache-dependency-path : |
194194 go.sum
195- .github/.cache/buster-for-unit-tests
195+ tests/go.sum
196196
197197 - name : Run Tests
198198 run : make unit-test
@@ -221,6 +221,8 @@ jobs:
221221 uses : actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
222222 with :
223223 node-version-file : .nvmrc
224+ cache : ' npm'
225+ cache-dependency-path : internal/controller/nginx/modules/package-lock.json
224226
225227 - name : Run tests
226228 run : npm --prefix ${{ github.workspace }}/internal/controller/nginx/modules install-ci-test
@@ -267,7 +269,7 @@ jobs:
267269 go-version : stable
268270 cache-dependency-path : |
269271 go.sum
270- .github/.cache/buster-for-binary
272+ tests/go.sum
271273
272274 - name : Set Go module cache
273275 run : |
@@ -299,7 +301,9 @@ jobs:
299301 uses : goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
300302 with :
301303 version : v2.12.7 # renovate: datasource=github-tags depName=goreleaser/goreleaser
302- args : ${{ (inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null)) && 'release' || 'build --snapshot' }} --clean
304+ # On PRs: build only amd64 for speed (tests run on amd64 runners)
305+ # On main/release: build both amd64 and arm64
306+ args : ${{ (inputs.is_production_release && (inputs.dry_run == false || inputs.dry_run == null)) && 'release' || (github.event_name == 'pull_request' && 'build --single-target --snapshot' || 'build --snapshot') }} --clean
303307 env :
304308 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
305309 GOPATH : ${{ needs.vars.outputs.go_path }}
@@ -408,7 +412,9 @@ jobs:
408412 fail-fast : false
409413 matrix :
410414 image : [ngf, nginx]
411- platforms : ["linux/arm64, linux/amd64"]
415+ # On PRs: build only amd64 for speed (tests run on amd64)
416+ # On main/release: build both amd64 and arm64
417+ platforms : ${{ github.event_name == 'pull_request' && fromJSON('["linux/amd64"]') || fromJSON('["linux/arm64, linux/amd64"]') }}
412418 # On PRs: only standard OS (2 jobs)
413419 # On main/release: include ubi (4 jobs)
414420 build-os : ${{ github.event_name == 'pull_request' && fromJSON('[""]') || fromJSON('["", "ubi"]') }}
@@ -439,7 +445,9 @@ jobs:
439445 build-os : ${{ github.event_name == 'pull_request' && fromJSON('[""]') || fromJSON('["", "ubi"]') }}
440446 with :
441447 image : plus
442- platforms : " linux/arm64, linux/amd64"
448+ # On PRs: build only amd64 for speed (tests run on amd64)
449+ # On main/release: build both amd64 and arm64
450+ platforms : ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/arm64, linux/amd64' }}
443451 build-os : ${{ matrix.build-os }}
444452 tag : ${{ inputs.release_version || '' }}
445453 dry_run : ${{ inputs.dry_run || false }}
@@ -457,7 +465,9 @@ jobs:
457465 uses : ./.github/workflows/build.yml
458466 with :
459467 image : operator
460- platforms : " linux/arm64, linux/amd64"
468+ # On PRs: build only amd64 for speed (tests run on amd64)
469+ # On main/release: build both amd64 and arm64
470+ platforms : ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/arm64, linux/amd64' }}
461471 tag : ${{ inputs.operator_version || '' }}
462472 dry_run : ${{ inputs.dry_run || false }}
463473 runner : ${{ github.repository_owner == 'nginx' && (inputs.is_production_release || ((github.event_name == 'push' || github.event_name == 'schedule') && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-')))) && 'ubuntu-24.04-amd64' || 'ubuntu-24.04' }}
@@ -591,7 +601,7 @@ jobs:
591601 go-version : stable
592602 cache-dependency-path : |
593603 go.sum
594- .github/.cache/buster-for-unit-tests
604+ tests/go.sum
595605
596606 - name : Deploy Kubernetes
597607 id : k8s
0 commit comments