From f36f4cd75a9ed3b3620675560b918bbe2671b862 Mon Sep 17 00:00:00 2001 From: Rein Krul Date: Mon, 18 May 2026 14:27:16 +0200 Subject: [PATCH] ci: speed up PR feedback Three independent CI tweaks targeting the ~13 min PR wall-clock: 1. go-test.yaml: drop `-p 1`. Inherited from CircleCI per-shard config during PR #4250 migration; the new GHA pipeline isn't sharded so the flag just serialized 137 packages on a single 2-core runner. Audit shows no inter-package parallelism hazards in the current codebase (no fixed-port net.Listen, no os.Chdir, no TestMain, no shared on-disk paths). Local empirical: -p 1 takes 7m04s, -p 2 takes 3m31s, both pass. Expected CI: 12m15s -> ~6m. 2. e2e-tests.yaml: add gha cache to both Build and push steps. Dockerfile already orders go.mod/go.sum download before COPY ., so the cache is effective on PRs that don't touch go.sum. Saves ~1-2 min after warm-up. 3. build-images.yaml: build amd64 only on PRs, multi-arch on push/tag. arm64 under QEMU is ~5-8x slower; PRs are push: false anyway, so we only verify build doesn't break - arm64 adds no signal. Saves ~20 runner-min/PR (not on critical path but reduces resource use). Also: add .scratch/ and .claude/scheduled_tasks.lock to .gitignore (per global preference - keeps local agent state out of commits). Refs #4258. Assisted by AI --- .github/workflows/build-images.yaml | 4 +++- .github/workflows/e2e-tests.yaml | 4 ++++ .github/workflows/go-test.yaml | 2 +- .gitignore | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 8e53dda6b9..f3483aae7f 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -75,7 +75,9 @@ jobs: with: context: . file: Dockerfile - platforms: linux/amd64,linux/arm64 + # On PRs we only verify the build doesn't break; arm64 under QEMU + # is ~5-8x slower and adds no signal there. Multi-arch on push/tag. + platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} build-args: | diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 79355f65f6..505376577b 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -60,6 +60,8 @@ jobs: platforms: linux/amd64 push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }} + cache-from: type=gha,scope=e2e + cache-to: type=gha,scope=e2e,mode=max secrets: | GIT_AUTH_TOKEN=${{ secrets.PACKAGE_SECRET }} @@ -72,6 +74,8 @@ jobs: platforms: linux/amd64 push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }} + cache-from: type=gha,scope=e2e + cache-to: type=gha,scope=e2e,mode=max - name: Run E2E tests run: | diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index 90a8dbb9df..4231cca56e 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -25,7 +25,7 @@ jobs: go-version-file: 'go.mod' - name: Test - run: go test -p 1 ./... -race -coverprofile=c_raw.out + run: go test ./... -race -coverprofile=c_raw.out - name: Filter coverage run: grep -v generated c_raw.out | grep -v mock | grep -v test > c.out diff --git a/.gitignore b/.gitignore index a12a097dc0..07ee438fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,7 @@ data /nuts-node nuts.yaml + +# Local scratch directory and Claude Code session state +.scratch/ +.claude/scheduled_tasks.lock