diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2cc04cca..5bb288c2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,7 +19,12 @@ jobs: ./cli-v2 install - name: "Run tests" run: | - go test ./... + go test -coverprofile=unit.coverage.out ./... + - name: "Upload coverage to Codacy" + env: + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + run: | + bash <(curl -Ls https://coverage.codacy.com/get.sh) report --force-coverage-parser go -r unit.coverage.out release: needs: test diff --git a/CLAUDE.md b/CLAUDE.md index 7f562e96..955ffe02 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -3,6 +3,7 @@ ## Build & Test Commands - Build: `go build ./cli-v2.go` - Run all tests: `go test ./...` +- Run all tests with coverage: `go test -coverprofile=unit.coverage.out ./...` - Run specific test: `go test -run TestName ./package/path` - Example: `go test -run TestGetTools ./tools` - Format code: `go fmt ./...`