Skip to content

Commit 6fb9e27

Browse files
authored
ci: simplify Go setup in GitHub Actions workflows (#82)
Remove explicit GO environment variable and version pinning in the checks workflow. Use go-version-file pointing to go.mod for setup-go action to automatically detect the Go version. This reduces maintenance overhead and ensures the Go version stays in sync with the project. Also, streamline steps by removing redundant step names for checkout and setup-go.
1 parent 09cefdb commit 6fb9e27

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

.github/workflows/checks.yaml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,29 @@ concurrency:
1414
group: ${{ format('{0}-{1}', github.workflow, github.head_ref) }}
1515
cancel-in-progress: true
1616

17-
env:
18-
GO: "1.24"
19-
2017
permissions: read-all
2118

2219
jobs:
2320
UnitTests:
2421
runs-on: ubuntu-latest
25-
2622
steps:
27-
- name: Checkout repository
28-
uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
29-
30-
- name: Install Go
31-
uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
23+
- uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
24+
- uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
3225
with:
33-
go-version: ${{ env.GO }}
34-
35-
- name: Run Unit Tests
36-
run: go test -race -cover -coverprofile=coverage.out -covermode=atomic
37-
26+
go-version-file: go.mod
27+
- run: go test -race -cover -coverprofile=coverage.out -covermode=atomic
3828
- name: Codecov
3929
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
4030
env:
4131
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4232

4333
GolangCI-Lint:
4434
runs-on: ubuntu-latest
45-
4635
steps:
47-
- name: Checkout repository
48-
uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
49-
50-
- name: Install Go
51-
uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
36+
- uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
37+
- uses: actions/[email protected] # immutable action, safe to use a version instead of hashtag
5238
with:
53-
go-version: ${{ env.GO }}
54-
55-
- name: Run GolangCi-Lint
56-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
39+
go-version-file: go.mod
40+
- uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
5741
with:
5842
version: latest

0 commit comments

Comments
 (0)