Skip to content

Commit 287815e

Browse files
committed
gha: extend matrix to include Windows and macOS, and lint on all
Combine "Lint" and "Test" into a single matrix so that linting runs on all versions of Go and all platforms. Some linters apply rules depending on Go version and we must avoid applying rules that are not applicable to older versions of Go that are supported by this module. Combining "Lint" and "Test" allows re-using the common steps, such as checking out the code and setting up Go; duration of tests and linting on this repository is short, so running Lint and Test in parallel does not gain much time. This patch also reduces the test matrix to "oldest supported version of Go (by this module), and currently supported versions of Go (current stable, and previous stable)". Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 0875728 commit 287815e

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@ permissions:
1212
jobs:
1313
test:
1414
name: Test
15-
runs-on: ubuntu-latest
15+
runs-on: ${{ matrix.platform }}
1616
timeout-minutes: 20 # guardrails timeout
1717

1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
go: ["1.12", "1.21", "1.22", "1.23", "oldstable", "stable"]
22-
21+
# Oldest supported + currently supported Go versions
22+
go: ["1.12.x", "oldstable", "stable"]
23+
platform: [ubuntu-latest, windows-latest, macos-latest]
24+
exclude:
25+
# go1.12 is not available for windows and macos on GitHub actions.
26+
- go: "1.12.x"
27+
platform: windows-latest
28+
- go: "1.12.x"
29+
platform: macos-latest
2330
steps:
2431
- name: Checkout repository
2532
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -34,20 +41,6 @@ jobs:
3441
# run: go test -race -v -shuffle=on ./...
3542
run: go test -race -v ./...
3643

37-
lint:
38-
name: Lint
39-
runs-on: ubuntu-latest
40-
timeout-minutes: 20 # guardrails timeout
41-
42-
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
45-
46-
- name: Set up Go
47-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
48-
with:
49-
go-version: "stable"
50-
5144
- name: Lint
5245
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
5346
with:

0 commit comments

Comments
 (0)