Skip to content

Commit a5e7d41

Browse files
committed
feat(workflows): Update test.yml to fix path caching issues
1 parent c1f61e4 commit a5e7d41

File tree

1 file changed

+15
-29
lines changed

1 file changed

+15
-29
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: services/bounty-service
1215

1316
steps:
1417
- name: Checkout code
@@ -17,42 +20,32 @@ jobs:
1720
- name: Set up Go
1821
uses: actions/setup-go@v4
1922
with:
20-
go-version: '1.24.3'
21-
22-
- name: Cache Go modules
23-
uses: actions/cache@v3
24-
continue-on-error: true
25-
with:
26-
path: |
27-
~/go/pkg/mod
28-
~/.cache/go-build
29-
key: ${{ runner.os }}-go-${{ hashFiles('services/bounty-service/go.sum') }}
30-
restore-keys: |
31-
${{ runner.os }}-go-
23+
go-version: '1.21.x'
24+
cache-dependency-path: services/bounty-service/go.sum
3225

3326
- name: Download dependencies
34-
working-directory: services/bounty-service
3527
run: go mod download
3628

3729
- name: Run tests
38-
working-directory: services/bounty-service
3930
run: go test -v ./...
4031

4132
- name: Run tests with coverage
42-
working-directory: services/bounty-service
4333
run: |
4434
go test -v -coverprofile=coverage.out ./...
4535
mv coverage.out ${{ github.workspace }}/coverage.out
4636
4737
- name: Upload coverage to Codecov
48-
uses: codecov/codecov-action@v3
38+
uses: codecov/codecov-action@v4
4939
with:
5040
file: ./coverage.out
5141
flags: unittests
5242
name: codecov-umbrella
5343

5444
lint:
5545
runs-on: ubuntu-latest
46+
defaults:
47+
run:
48+
working-directory: services/bounty-service
5649

5750
steps:
5851
- name: Checkout code
@@ -61,22 +54,15 @@ jobs:
6154
- name: Set up Go
6255
uses: actions/setup-go@v4
6356
with:
64-
go-version: '1.24.3'
57+
go-version: '1.21.x'
58+
cache-dependency-path: services/bounty-service/go.sum
6559

66-
- name: Cache Go build
67-
uses: actions/cache@v3
68-
continue-on-error: true
69-
with:
70-
path: |
71-
~/go/pkg/mod
72-
~/.cache/go-build
73-
key: ${{ runner.os }}-go-${{ hashFiles('services/bounty-service/go.sum') }}
74-
restore-keys: |
75-
${{ runner.os }}-go-
60+
- name: Download dependencies
61+
run: go mod download
7662

7763
- name: Run golangci-lint
78-
uses: golangci/golangci-lint-action@v3
64+
uses: golangci/golangci-lint-action@v4
7965
with:
8066
version: latest
8167
working-directory: services/bounty-service
82-
args: --timeout=5m --out-format=colored-line-number
68+
args: --timeout=5m --out-format=colored-line-number

0 commit comments

Comments
 (0)