Skip to content

Commit

Permalink
ci: refactor CI/CD workflows and dependencies
Browse files Browse the repository at this point in the history
- Update the CodeQL GitHub action from v2 to v3 in codeql.yml
- Add checkout step with actions/checkout@v4 in go.yml
- Replace hardcoded go-version with dynamic version from go.mod and enable latest version check in go.yml
- Update the golangci-lint GitHub action from v3 to v4 in go.yml
- Add Go version 1.22 to the test matrix in go.yml
- Update the cache action from v3 to v4 in go.yml
- Replace hardcoded go-version with dynamic version from go.mod and enable latest version check in goreleaser.yml
- Change goreleaser argument from `--rm-dist` to `--clean` in goreleaser.yml

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Mar 1, 2024
1 parent d017ca5 commit 5d56699
Show file tree
Hide file tree
Showing 3 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
13 changes: 7 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ 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.16"
- 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
test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.19, "1.20", 1.21]
go: [1.19, "1.20", 1.21, 1.22]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
Expand All @@ -49,7 +50,7 @@ jobs:
with:
ref: ${{ github.ref }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
${{ matrix.go-build }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ jobs:
- name: Set up 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 }}

0 comments on commit 5d56699

Please sign in to comment.