Skip to content

Commit

Permalink
ci: update GitHub Actions and dependencies
Browse files Browse the repository at this point in the history
- 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 <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Apr 2, 2024
1 parent 19e0377 commit 9b0c284
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1"
- name: Checkout repository
uses: actions/checkout@v4
go-version-file: go.mod
check-latest: true

- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --verbose

# Label of the container job
test:
strategy:
matrix:
os: [ubuntu-latest]
go: ["1.20", 1.21]
go: ["1.20", 1.21, 1.22]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
Expand Down Expand Up @@ -53,7 +57,7 @@ jobs:
with:
ref: ${{ github.ref }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
${{ matrix.go-build }}
Expand All @@ -66,6 +70,6 @@ jobs:
go test -v -covermode=atomic -coverprofile=coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: ${{ matrix.os }},go-${{ matrix.go }}
11 changes: 6 additions & 5 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1"
go-version-file: go.mod
check-latest: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down

0 comments on commit 9b0c284

Please sign in to comment.