Skip to content

Commit 36c7b14

Browse files
ci: use setup-go built-in caching instead of manual step
1 parent 82f5147 commit 36c7b14

1 file changed

Lines changed: 7 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,13 @@ jobs:
1919
- name: Checkout code
2020
uses: actions/checkout@v4 # Use latest checkout action
2121

22-
- name: Cache Go modules
23-
uses: actions/cache@v4 # Use latest cache action
24-
with:
25-
path: ~/go/pkg/mod
26-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
27-
restore-keys: |
28-
${{ runner.os }}-go-
2922

3023
- name: Set up Go
3124
uses: actions/setup-go@v5 # Use latest setup-go action
3225
with:
3326
go-version: 'stable' # Or pin to a specific version e.g., '1.22.x'
27+
cache: true
3428

35-
- name: Cache Chocolatey packages
36-
uses: actions/cache@v4
37-
with:
38-
path: C:\ProgramData\chocolatey\lib # Correct default Chocolatey lib path
39-
key: ${{ runner.os }}-chocolatey-${{ hashFiles('**/tools.txt') }} # Assuming you might have a tools.txt
40-
restore-keys: |
41-
${{ runner.os }}-chocolatey-
4229

4330
- name: Install GCC (if not cached)
4431
run: choco install mingw -y --no-progress
@@ -48,9 +35,11 @@ jobs:
4835

4936
# Removed redundant 'go get fyne...' step here
5037

51-
- name: Run lint
52-
run: make lint
53-
shell: pwsh
38+
- name: golangci-lint
39+
uses: golangci/golangci-lint-action@v6
40+
with:
41+
version: v1.64.6 # Pinned to a recent stable version
42+
args: --timeout=10m ./...
5443

5544
- name: Run tests
5645
run: go test ./...
@@ -63,18 +52,12 @@ jobs:
6352
- name: Checkout code
6453
uses: actions/checkout@v4
6554

66-
- name: Cache Go modules
67-
uses: actions/cache@v4
68-
with:
69-
path: ~/go/pkg/mod
70-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
71-
restore-keys: |
72-
${{ runner.os }}-go-
7355

7456
- name: Set up Go
7557
uses: actions/setup-go@v5
7658
with:
7759
go-version: '1.25.3' # Or pin to a specific version e.g., '1.22.x'
60+
cache: true
7861

7962
- name: Cache Chocolatey packages
8063
uses: actions/cache@v4

0 commit comments

Comments
 (0)