Skip to content

Commit 553901a

Browse files
committed
ci: refactor CI workflows and Go configurations
- Update GitHub CodeQL action to version 3 in codeql.yml - Modify Go setup in docker.yml to use `go-version-file` and `check-latest` options - Rename checkout step and update Go setup in goreleaser.yml - Change goreleaser argument from `--rm-dist` to `--clean` - Add checkout step with `fetch-depth: 0` in testing.yml - Remove redundant Go setup and checkout steps in testing.yml Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent d95ca55 commit 553901a

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
45+
uses: github/codeql-action/init@v3
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,4 +51,4 @@ jobs:
5151
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@v2
54+
uses: github/codeql-action/analyze@v3

.github/workflows/docker.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ jobs:
1414
build-docker:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: Setup go
18-
uses: actions/setup-go@v5
19-
with:
20-
go-version: "^1"
2117
- name: Checkout repository
2218
uses: actions/checkout@v4
2319
with:
2420
fetch-depth: 0
2521

22+
- name: Setup go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
check-latest: true
27+
2628
- name: Build binary
2729
run: |
2830
make build_linux_amd64

.github/workflows/goreleaser.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout
15+
- name: Checkout repository
1616
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19+
1920
- name: Setup go
2021
uses: actions/setup-go@v5
2122
with:
22-
go-version: "^1"
23+
go-version-file: go.mod
24+
check-latest: true
2325

2426
- name: Run GoReleaser
2527
uses: goreleaser/goreleaser-action@v5
2628
with:
2729
# either 'goreleaser' (default) or 'goreleaser-pro'
2830
distribution: goreleaser
2931
version: latest
30-
args: release --rm-dist
32+
args: release --clean
3133
env:
3234
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/testing.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ jobs:
1717
lint:
1818
runs-on: ubuntu-latest
1919
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
2025
- name: Setup go
2126
uses: actions/setup-go@v5
2227
with:
23-
go-version: "^1"
24-
- name: Checkout repository
25-
uses: actions/checkout@v4
28+
go-version-file: go.mod
29+
check-latest: true
2630
- name: Setup golangci-lint
2731
uses: golangci/golangci-lint-action@v3
2832
with:

0 commit comments

Comments
 (0)