Skip to content

Commit 9b0c284

Browse files
committed
ci: update GitHub Actions and dependencies
- Update GitHub Actions to use `checkout@v4` in `go.yml` - Specify `go-version-file` and enable `check-latest` for Go version in `go.yml` - Upgrade `golangci-lint-action` to `v4` in `go.yml` - Add Go version `1.22` to the test matrix in `go.yml` - Update GitHub Actions to use `cache@v4` in `go.yml` - Upgrade `codecov-action` to `v4` in `go.yml` - Rename job step to "Checkout repository" and remove `fetch-depth` configuration in `goreleaser.yml` - Add `go-version-file` and enable `check-latest` for Go version in `goreleaser.yml` Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 19e0377 commit 9b0c284

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.github/workflows/go.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,27 @@ jobs:
55
lint:
66
runs-on: ubuntu-latest
77
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v4
10+
811
- name: Setup go
912
uses: actions/setup-go@v5
1013
with:
11-
go-version: "^1"
12-
- name: Checkout repository
13-
uses: actions/checkout@v4
14+
go-version-file: go.mod
15+
check-latest: true
16+
1417
- name: Setup golangci-lint
15-
uses: golangci/golangci-lint-action@v3
18+
uses: golangci/golangci-lint-action@v4
1619
with:
20+
version: latest
1721
args: --verbose
1822

1923
# Label of the container job
2024
test:
2125
strategy:
2226
matrix:
2327
os: [ubuntu-latest]
24-
go: ["1.20", 1.21]
28+
go: ["1.20", 1.21, 1.22]
2529
include:
2630
- os: ubuntu-latest
2731
go-build: ~/.cache/go-build
@@ -53,7 +57,7 @@ jobs:
5357
with:
5458
ref: ${{ github.ref }}
5559

56-
- uses: actions/cache@v3
60+
- uses: actions/cache@v4
5761
with:
5862
path: |
5963
${{ matrix.go-build }}
@@ -66,6 +70,6 @@ jobs:
6670
go test -v -covermode=atomic -coverprofile=coverage.out
6771
6872
- name: Upload coverage to Codecov
69-
uses: codecov/codecov-action@v3
73+
uses: codecov/codecov-action@v4
7074
with:
7175
flags: ${{ matrix.os }},go-${{ matrix.go }}

.github/workflows/goreleaser.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout
15+
- name: Checkout repository
1616
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- name: Set up Go
17+
18+
- name: Setup go
2019
uses: actions/setup-go@v5
2120
with:
22-
go-version: "^1"
21+
go-version-file: go.mod
22+
check-latest: true
23+
2324
- name: Run GoReleaser
2425
uses: goreleaser/goreleaser-action@v5
2526
with:

0 commit comments

Comments
 (0)