Skip to content

Commit 9f00992

Browse files
committed
gha: tweak settings, add testing for "stable" and "oldstable" go
- set default permissions to "content: read" as actions in this repository don't require write acccess. - set a guardrails timeout; this should not be needed normally, but GitHub's default timeout is 6 Hours, and prevents runaway actions that may happen occasionally on GitHub service outages. - remove filter for branch name and run on pull-requests, push events - add "stable" and "oldstable" Go versions to the matrix; these always point to the currently maintained versions of Go (currently Go1.25 and Go1.24). Using the fixed ("oldstable", "stable") keywords reduces maintainance and helps marking checks as "required" in branch protection, as such options are using the name generated from the matrix. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 09b9940 commit 9f00992

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches: [master]
6-
pull_request:
3+
on: [push, pull_request]
4+
5+
# Default to 'contents: read', which grants actions to read commits. Any
6+
# permission not included is implicitly set to "none".
7+
#
8+
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: read
711

812
jobs:
913
test:
1014
name: Test
1115
runs-on: ubuntu-latest
16+
timeout-minutes: 20 # guardrails timeout
1217

1318
strategy:
1419
fail-fast: false
1520
matrix:
16-
go: ["1.12", "1.21", "1.22", "1.23"]
21+
go: ["1.12", "1.21", "1.22", "1.23", "oldstable", "stable"]
1722

1823
steps:
1924
- name: Checkout repository
@@ -32,6 +37,7 @@ jobs:
3237
lint:
3338
name: Lint
3439
runs-on: ubuntu-latest
40+
timeout-minutes: 20 # guardrails timeout
3541

3642
steps:
3743
- name: Checkout repository
@@ -40,7 +46,7 @@ jobs:
4046
- name: Set up Go
4147
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
4248
with:
43-
go-version: "1.23"
49+
go-version: "stable"
4450

4551
- name: Lint
4652
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0

0 commit comments

Comments
 (0)