Skip to content

Commit 2b8ca02

Browse files
authored
Merge pull request #31 from codacy/addCoverageUpload
test: Add coverage upload step to GitHub Action workflow
2 parents c56872d + 4f13675 commit 2b8ca02

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/go.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ jobs:
1919
./cli-v2 install
2020
- name: "Run tests"
2121
run: |
22-
go test ./...
22+
go test -coverprofile=unit.coverage.out ./...
23+
- name: "Upload coverage to Codacy"
24+
env:
25+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
26+
run: |
27+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r unit.coverage.out
2328
2429
release:
2530
needs: test

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Build & Test Commands
44
- Build: `go build ./cli-v2.go`
55
- Run all tests: `go test ./...`
6+
- Run all tests with coverage: `go test -coverprofile=unit.coverage.out ./...`
67
- Run specific test: `go test -run TestName ./package/path`
78
- Example: `go test -run TestGetTools ./tools`
89
- Format code: `go fmt ./...`

0 commit comments

Comments
 (0)