Skip to content

Commit

Permalink
ci: update GitHub Actions configurations for Go projects
Browse files Browse the repository at this point in the history
- Update CodeQL action from version 2 to version 3 in `.github/workflows/codeql.yml`
- Change the step name from "Checkout" to "Checkout repository" in `.github/workflows/goreleaser.yml`
- Modify the Go version setup from 1.17 to using a version file and checking the latest in `.github/workflows/goreleaser.yml`
- Adjust the GoReleaser arguments from `release --rm-dist` to `release --clean` in `.github/workflows/goreleaser.yml`
- Upgrade the golangci-lint action from version 3 to version 4 in `.github/workflows/lint.yml`
- Expand the Go version range from `[1.20, 1.21]` to `[1.20, 1.21, 1.22]` in `.github/workflows/lint.yml` and `.github/workflows/testing.yml`
- Update the codecov action from version 3 to version 4 in `.github/workflows/testing.yml`

Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Mar 24, 2024
1 parent 5c9a349 commit 076c06f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
10 changes: 6 additions & 4 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ 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.17
go-version-file: go.mod
check-latest: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: ["1.20", 1.21]
go: ["1.20", 1.21, 1.22]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}

Expand All @@ -26,7 +26,7 @@ jobs:
ref: ${{ github.ref }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --verbose --timeout 10m
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.19, "1.20", 1.21]
go: [1.19, "1.20", 1.21, 1.22]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -53,4 +53,4 @@ jobs:
go test -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4

0 comments on commit 076c06f

Please sign in to comment.