Skip to content

Commit 9e20f80

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). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 8cb3877 commit 9e20f80

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.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@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4248
with:
43-
go-version: "1.23"
49+
go-version: "stable"
4450

4551
- name: Lint
4652
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0

0 commit comments

Comments
 (0)