Skip to content

Commit 31ad85d

Browse files
authored
Merge pull request #455 from jaypipes/update-gh-workflows
update Github Actions workflows for more modern Go
2 parents 168d775 + d6efcd5 commit 31ad85d

3 files changed

Lines changed: 57 additions & 32 deletions

File tree

.github/workflows/fmtcheck.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: harden runner
17-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
17+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
1818
with:
1919
egress-policy: block
2020
disable-sudo: true
@@ -26,11 +26,13 @@ jobs:
2626
raw.githubusercontent.com:443
2727
objects.githubusercontent.com:443
2828
proxy.golang.org:443
29+
storage.googleapis.com:443
30+
release-assets.githubusercontent.com:443
2931
- name: checkout code
30-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3133
- name: setup go
32-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
34+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
3335
with:
34-
go-version: 1.24
36+
go-version: 1.26
3537
- name: check fmt
3638
run: 'bash -c "diff -u <(echo -n) <(gofmt -d .)"'

.github/workflows/lint.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,29 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: harden runner
18-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
18+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
1919
with:
20-
egress-policy: audit
20+
egress-policy: block
2121
disable-sudo: true
22+
allowed-endpoints: >
23+
github.com:443
24+
api.github.com:443
25+
proxy.github.com:443
26+
proxy.golang.org:443
27+
raw.githubusercontent.com:443
28+
objects.githubusercontent.com:443
29+
proxy.golang.org:443
30+
storage.googleapis.com:443
31+
release-assets.githubusercontent.com:443
2232
- name: checkout code
23-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2434
- name: setup go
25-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
35+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
2636
with:
27-
go-version: 1.24
37+
go-version: 1.26
2838
- name: lint
29-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
39+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
3040
with:
31-
version: v2.2.0
41+
version: v2.11
3242
args: --timeout=5m0s --verbose
3343
only-new-issues: true

.github/workflows/test.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
go: ['1.22', '1.23', '1.24']
20+
go: ['1.24', '1.25', '1.26']
2121
steps:
2222
- name: harden runner
23-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
23+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
2424
with:
2525
egress-policy: block
2626
disable-sudo: true
@@ -32,10 +32,12 @@ jobs:
3232
raw.githubusercontent.com:443
3333
objects.githubusercontent.com:443
3434
proxy.golang.org:443
35+
storage.googleapis.com:443
36+
release-assets.githubusercontent.com:443
3537
- name: checkout code
36-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3739
- name: setup go
38-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
40+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
3941
with:
4042
go-version: ${{ matrix.go }}
4143
- name: run tests
@@ -51,12 +53,12 @@ jobs:
5153
runs-on: ubuntu-22.04
5254
strategy:
5355
matrix:
54-
go: ['1.21', '1.22', '1.23']
56+
go: ['1.26']
5557
steps:
5658
- name: harden runner
57-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
59+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
5860
with:
59-
egress-policy: audit
61+
egress-policy: block
6062
disable-sudo: true
6163
allowed-endpoints: >
6264
github.com:443
@@ -66,10 +68,12 @@ jobs:
6668
raw.githubusercontent.com:443
6769
objects.githubusercontent.com:443
6870
proxy.golang.org:443
71+
storage.googleapis.com:443
72+
release-assets.githubusercontent.com:443
6973
- name: checkout code
70-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
74+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7175
- name: setup go
72-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
76+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
7377
with:
7478
go-version: ${{ matrix.go }}
7579
- name: run tests
@@ -85,10 +89,10 @@ jobs:
8589
runs-on: windows-latest
8690
strategy:
8791
matrix:
88-
go: ['1.23', '1.24', '1.24']
92+
go: ['1.24', '1.25', '1.26']
8993
steps:
9094
- name: harden runner
91-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
95+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
9296
with:
9397
egress-policy: block
9498
disable-sudo: true
@@ -100,10 +104,12 @@ jobs:
100104
raw.githubusercontent.com:443
101105
objects.githubusercontent.com:443
102106
proxy.golang.org:443
107+
storage.googleapis.com:443
108+
release-assets.githubusercontent.com:443
103109
- name: checkout code
104-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
110+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
105111
- name: setup go
106-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
112+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
107113
with:
108114
go-version: ${{ matrix.go }}
109115
- name: run tests
@@ -129,10 +135,10 @@ jobs:
129135
runs-on: macos-latest
130136
strategy:
131137
matrix:
132-
go: ['1.22', '1.23']
138+
go: ['1.26']
133139
steps:
134140
- name: harden runner
135-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
141+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
136142
with:
137143
egress-policy: block
138144
disable-sudo: true
@@ -144,10 +150,12 @@ jobs:
144150
raw.githubusercontent.com:443
145151
objects.githubusercontent.com:443
146152
proxy.golang.org:443
153+
storage.googleapis.com:443
154+
release-assets.githubusercontent.com:443
147155
- name: checkout code
148-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
156+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
149157
- name: setup go
150-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
158+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
151159
with:
152160
go-version: ${{ matrix.go }}
153161
- name: run tests
@@ -161,6 +169,7 @@ jobs:
161169
GHW_TESTING_SKIP_PCI: "1"
162170
GHW_TESTING_SKIP_TOPOLOGY: "1"
163171
run: go test -v ./...
172+
164173
unsupported-platforms:
165174
runs-on: ubuntu-latest
166175
strategy:
@@ -169,7 +178,7 @@ jobs:
169178
os: ['freebsd', 'netbsd', 'openbsd', 'plan9']
170179
steps:
171180
- name: harden runner
172-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
181+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
173182
with:
174183
egress-policy: block
175184
disable-sudo: true
@@ -181,11 +190,15 @@ jobs:
181190
raw.githubusercontent.com:443
182191
objects.githubusercontent.com:443
183192
proxy.golang.org:443
193+
storage.googleapis.com:443
194+
release-assets.githubusercontent.com:443
184195
- name: checkout code
185-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
196+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
186197
- name: setup go
187-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
188-
- name: unsupported platforms
198+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
199+
with:
200+
go-version: 1.26
201+
- name: build
189202
env:
190203
GOOS: ${{ matrix.os }}
191204
# Run a simple build to make sure the code builds on (some) unsupported platforms.

0 commit comments

Comments
 (0)