Skip to content

Commit bab9a7a

Browse files
cweillclaude
andcommitted
ci: revert to goveralls for coverage reporting
Reverted coverage reporting to use goveralls tool (like the original implementation) instead of the GitHub Action. This approach provides better control over which packages are included in coverage metrics. Changes: - Install goveralls tool before coverage generation - Filter packages to exclude: gotests/gotests, testdata, templates - Use -coverpkg flag to specify which packages to measure - Upload to Coveralls using goveralls command - Changed coverage file back to coverage.out - Keep Codecov upload for dual reporting This matches the original coverage approach from commit 3dcf5ef but updated for modern Go versions (1.22-1.25). The filtered coverage focuses on library packages: - github.com/cweill/gotests (main library) - internal/goparser - internal/input - internal/models - internal/output - internal/render Excludes CLI and test data packages from coverage metrics. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 11e7511 commit bab9a7a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/go.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,27 @@ jobs:
3030
- name: Test
3131
run: go test -v ./...
3232

33-
- name: Coverage
33+
- name: Coverage Dependencies
34+
if: matrix.go == '1.25.x'
35+
run: go install github.com/mattn/goveralls@latest
36+
37+
- name: Coverage Reporting Generation
3438
if: matrix.go == '1.25.x'
3539
run: |
36-
go test -v -covermode=count -coverprofile=coverage.txt -coverpkg=./... ./...
40+
export PKGS=$(go list ./... | grep -vE "(gotests/gotests|.*data|templates)" | tr -s '\n' ',' | sed 's/.\{1\}$//')
41+
go test -v -covermode=count -coverpkg=$PKGS -coverprofile=coverage.out ./...
3742
3843
- name: Upload coverage to Coveralls
3944
if: matrix.go == '1.25.x'
40-
uses: coverallsapp/github-action@v2
41-
with:
42-
github-token: ${{ secrets.GITHUB_TOKEN }}
43-
path-to-lcov: coverage.txt
45+
run: goveralls -coverprofile=coverage.out -service=github
46+
env:
47+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4448

4549
- name: Upload coverage to Codecov
4650
if: matrix.go == '1.25.x'
4751
uses: codecov/codecov-action@v5
4852
with:
4953
token: ${{ secrets.CODECOV_TOKEN }}
50-
files: ./coverage.txt
54+
files: ./coverage.out
5155
fail_ci_if_error: false
5256
verbose: true

0 commit comments

Comments
 (0)