Skip to content

Commit decff55

Browse files
Merge pull request #64 from sensu/workflow-fix
chore: upgrade Go version and update CI workflows
2 parents 2d19a6d + cf9e5cb commit decff55

File tree

4 files changed

+53
-13
lines changed

4 files changed

+53
-13
lines changed

.github/workflows/static-check.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
name: static-check
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
48

59
jobs:
610
staticcheck:
711
name: staticcheck (project)
812
runs-on: ubuntu-latest
913
steps:
10-
- uses: actions/checkout@v1
14+
- name: Checkout code
15+
uses: actions/checkout@v4
1116
with:
1217
fetch-depth: 1
13-
- uses: dominikh/[email protected]
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
1420
with:
15-
version: "2023.1.3"
16-
env:
17-
GO_VERSION: 1.20.x
21+
go-version: '1.23'
22+
check-latest: true
23+
- name: Cache Go modules
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Download dependencies
31+
run: go mod download
32+
- name: Install staticcheck
33+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
34+
- name: Run staticcheck
35+
run: staticcheck ./...
36+
- name: Run go vet
37+
run: go vet ./...
38+
- name: Run go fmt check
39+
run: |
40+
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
41+
echo "The following files are not formatted:"
42+
gofmt -s -l .
43+
exit 1
44+
fi

.github/workflows/test.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Go Test
22

3-
on: [push,pull_request]
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
48

59
jobs:
610
test:
@@ -11,11 +15,18 @@ jobs:
1115
os: [macos-latest, windows-latest, ubuntu-latest]
1216
steps:
1317
- name: Checkout code
14-
uses: actions/checkout@v2
15-
- name: Set up Go 1.20
16-
uses: actions/setup-go@v1
18+
uses: actions/checkout@v4
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
1721
with:
18-
go-version: 1.20.x
19-
id: go
22+
go-version: '1.23'
23+
check-latest: true
24+
- name: Cache Go modules
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
2031
- name: Test
2132
run: go test -v ./...

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/sensu/sensu-pagerduty-handler
22

3-
go 1.20
3+
go 1.23
44

55
require (
66
github.com/sensu/core/v2 v2.16.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
4848
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
4949
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
5050
github.com/echlebek/crock v1.0.1 h1:KbzamClMIfVIkkjq/GTXf+N16KylYBpiaTitO3f1ujg=
51+
github.com/echlebek/crock v1.0.1/go.mod h1:/kvwHRX3ZXHj/kHWJkjXDmzzRow54EJuHtQ/PapL/HI=
5152
github.com/echlebek/timeproxy v1.0.0 h1:V41/v8tmmMDNMA2GrBPI45nlXb3F7+OY+nJz1BqKsCk=
5253
github.com/echlebek/timeproxy v1.0.0/go.mod h1:0dg2Lnb8no/jFwoMQKMTU6iAivgoMptGqSTprhnrRtk=
5354
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -214,6 +215,7 @@ github.com/sensu/core/v2 v2.16.1/go.mod h1:2etWGsa+nx5G2Q3CKiSJY9kSg8VhCgGzgp1Vy
214215
github.com/sensu/sensu-api-tools v0.1.0 h1:ctEyFIY1aKis1KqL7wOo+Apg/5t9X6vBVLzrqUUuBkQ=
215216
github.com/sensu/sensu-api-tools v0.1.0/go.mod h1:SNISS4OhwNSZI9/YKTQr1bghOEwed9ZT4v+ztKk1Mq0=
216217
github.com/sensu/sensu-go/types v0.12.0 h1:t8gupS1QhkuA/b9LzTaF0h6DBGHX2UzKHyuBPhj/PoA=
218+
github.com/sensu/sensu-go/types v0.12.0/go.mod h1:PHk3pUJHCsFzoXnKmm9ERfnHnerzaG2rjISWGcZq3os=
217219
github.com/sensu/sensu-licensing/v2 v2.2.1 h1:9JI4iVm4ujWN4etI/Kdper6Q2lOn3HIEaGe234N8j40=
218220
github.com/sensu/sensu-licensing/v2 v2.2.1/go.mod h1:53lwddwN4XwZUld5KtnWQduSH6F8rBOsWuEk2EUeooI=
219221
github.com/sensu/sensu-plugin-sdk v0.19.0 h1:5r8f/+b0EY2YlNHyNYIY2pYz77JgGHvutFNCjReqMJE=

0 commit comments

Comments
 (0)