Skip to content

Commit 89db34b

Browse files
committed
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.
1 parent dc20f41 commit 89db34b

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
strategy:
88
matrix:
99
go_version:
10+
# Our developer environment (especially the code generator)
11+
# must work with all the supported Go releases.
1012
- stable
1113
- oldstable
1214
steps:
@@ -18,13 +20,19 @@ jobs:
1820
- run: ./.ci.gogenerate.sh
1921
- run: ./.ci.gofmt.sh
2022
- run: ./.ci.govet.sh
21-
- run: go test -v -race ./...
2223

23-
test-old-go:
24+
test:
2425
runs-on: ubuntu-latest
2526
strategy:
2627
matrix:
2728
go_version:
29+
# Tested version are ordered for faster useful feedback:
30+
# 'stable' and 'oldstable' are the most important
31+
# then the oldest supported version from go.mod
32+
# then the other intermediary Go versions (which, at this point
33+
# have low chance to fail if the other succeeded)
34+
- stable
35+
- oldstable
2836
- "1.17"
2937
- "1.18"
3038
- "1.19"
@@ -39,7 +47,8 @@ jobs:
3947
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
4048
with:
4149
go-version: ${{ matrix.go_version }}
42-
- run: go test -v -race ./...
50+
- name: Test
51+
run: go test -v -race ./...
4352

4453
check-actions-hashes:
4554
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)