Skip to content

Commit 226fbfd

Browse files
committed
feat(workflows): Fix test workflow
1 parent 14c9993 commit 226fbfd

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,47 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8-
workflow_dispatch:
98

109
jobs:
1110
test:
1211
runs-on: ubuntu-latest
13-
1412
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1715

18-
- name: Set up Go
19-
uses: actions/setup-go@v4
20-
with:
21-
go-version: '1.24.3'
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
18+
with:
19+
go-version: '1.24.3'
2220

23-
- name: Cache Go modules
24-
uses: actions/cache@v3
25-
with:
26-
path: ~/go/pkg/mod
27-
key: ${{ runner.os }}-go-${{ hashFiles('services/bounty-service/go.sum') }}
28-
restore-keys: |
29-
${{ runner.os }}-go-
21+
- name: Cache Go modules
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/go/pkg/mod
25+
key: ${{ runner.os }}-go-${{ hashFiles('services/bounty-service/go.sum') }}
26+
restore-keys: |
27+
${{ runner.os }}-go-
3028
31-
- name: Download dependencies
32-
run: |
33-
cd services/bounty-service
34-
go mod download
29+
- name: Download dependencies
30+
working-directory: services/bounty-service
31+
run: go mod download
3532

36-
- name: Run tests
37-
run: |
38-
cd services/bounty-service
39-
go test -v ./...
33+
- name: Run tests
34+
working-directory: services/bounty-service
35+
run: go test -v ./...
4036

41-
- name: Run tests with coverage
42-
run: |
43-
cd services/bounty-service
44-
go test -v -coverprofile=coverage.out ./...
45-
mv coverage.out ${{ github.workspace }}/coverage.out
37+
- name: Run tests with coverage
38+
working-directory: services/bounty-service
39+
run: |
40+
go test -v -coverprofile=coverage.out ./...
41+
mv coverage.out ${{ github.workspace }}/coverage.out
4642
47-
- name: Upload coverage to Codecov
48-
uses: codecov/codecov-action@v3
49-
with:
50-
file: ./coverage.out
51-
flags: unittests
52-
name: codecov-umbrella
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@v3
45+
with:
46+
file: ./coverage.out
47+
flags: unittests
48+
name: codecov-umbrella
5349

5450
lint:
5551
runs-on: ubuntu-latest
@@ -66,4 +62,5 @@ jobs:
6662
uses: golangci/golangci-lint-action@v3
6763
with:
6864
version: latest
69-
args: --timeout=5m --path-prefix=services/bounty-service
65+
working-directory: services/bounty-service
66+
args: --timeout=5m --out-format=colored-line-number

0 commit comments

Comments
 (0)