From 89db34b0295ed46478b938539c152cbd7fdd92f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Tue, 16 Sep 2025 15:19:34 +0200 Subject: [PATCH] CI: run tests separately from build jobs Reorganize GitHub Actions workflows to run tests the same way on all Go versions, and so remove running tests from the 'build' jobs (which run job only on 'oldstable' and 'stable'). This makes the build matrix of the 'test' job more consistent. Add comments explaining the logic of each build matrix. --- .github/workflows/main.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e9977b72..60252870d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,8 @@ jobs: strategy: matrix: go_version: + # Our developer environment (especially the code generator) + # must work with all the supported Go releases. - stable - oldstable steps: @@ -18,13 +20,19 @@ jobs: - run: ./.ci.gogenerate.sh - run: ./.ci.gofmt.sh - run: ./.ci.govet.sh - - run: go test -v -race ./... - test-old-go: + test: runs-on: ubuntu-latest strategy: matrix: go_version: + # Tested version are ordered for faster useful feedback: + # 'stable' and 'oldstable' are the most important + # then the oldest supported version from go.mod + # then the other intermediary Go versions (which, at this point + # have low chance to fail if the other succeeded) + - stable + - oldstable - "1.17" - "1.18" - "1.19" @@ -39,7 +47,8 @@ jobs: uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: ${{ matrix.go_version }} - - run: go test -v -race ./... + - name: Test + run: go test -v -race ./... check-actions-hashes: runs-on: ubuntu-latest