Skip to content

Commit 606f409

Browse files
committed
add coverage report option for Ci
1 parent e464704 commit 606f409

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/go.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@ jobs:
2121
with:
2222
go-version: '1.24'
2323

24+
- name: Install dependencies
25+
run: go mod tidy
26+
2427
- name: Build
2528
run: go build -v ./...
2629

27-
- name: Test
28-
run: go test -v ./...
30+
- name: Run tests with coverage
31+
run: |
32+
go test ./... -coverprofile=coverage.out
33+
go tool cover -html=coverage.out -o coverage.html
34+
35+
- name: Upload coverage report
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: coverage-report
39+
path: coverage.html

0 commit comments

Comments
 (0)