The GitHub Actions workflow generates coverage data (coverage.out) but never uploads it to Coveralls.io. The workflow stops after generating the coverage file.
The current workflow has:
- name: Update coverage
run: |
go test -tags test -covermode=atomic -coverprofile=coverage.out ./...
if: ${{ runner.os == 'Linux' && matrix.go-version == '1.23' }}But there's no step to send this data to Coveralls.
The Coveralls page (https://coveralls.io/github/mariow/nicmanager-export?branch=master) appears empty, suggesting the repository hasn't been properly added to Coveralls.io.
The integration appears to be from an older era when Go coverage required conversion to LCOV format. Modern Coveralls supports Go coverage natively.
- Go to Coveralls.io
- Sign in with GitHub account
- Go to ADD REPOS
- Find
mariow/nicmanager-exportand toggle it ON - Note the repo token (if needed for private repos)
Replace the current coverage step with a complete Coveralls integration:
- name: Generate coverage report
run: go test -tags test -covermode=atomic -coverprofile=coverage.out ./...
if: ${{ runner.os == 'Linux' && matrix.go-version == '1.23' }}
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.out
format: golang
if: ${{ runner.os == 'Linux' && matrix.go-version == '1.23' }}For public repositories, the GITHUB_TOKEN is usually sufficient. For private repositories:
- Go to repository Settings → Secrets and variables → Actions
- Add a new repository secret named
COVERALLS_REPO_TOKEN - Use the token from Coveralls.io
- Update the workflow to use:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
Here's the complete updated workflow section:
- name: Generate coverage report
run: go test -tags test -covermode=atomic -coverprofile=coverage.out ./...
if: ${{ runner.os == 'Linux' && matrix.go-version == '1.23' }}
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.out
format: golang
fail-on-error: false
if: ${{ runner.os == 'Linux' && matrix.go-version == '1.23' }}Modern Coveralls supports Go coverage format directly - no conversion needed.
- Uses official
coverallsapp/github-action@v2.3.0 - Specifies
format: golangfor native Go coverage support - Uses built-in
GITHUB_TOKENfor public repos
- Added
fail-on-error: falseto prevent CI failures if Coveralls is temporarily unavailable
- Only runs on Linux with Go 1.23 to avoid duplicate uploads
- Maintains existing conditional logic
- Coverage Badge: The badge in README.md will show actual coverage percentage
- PR Comments: Coveralls will add comments to pull requests showing coverage changes
- Coverage Tracking: Historical coverage data will be tracked over time
- Notifications: Optional notifications for coverage changes
- Apply the workflow changes
- Push to master branch
- Check GitHub Actions logs for successful Coveralls upload
- Verify coverage appears on Coveralls.io
- Test with a pull request to see PR comments
If Coveralls continues to have issues, consider modern alternatives:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: coverage.out
fail_ci_if_error: falseUse GitHub's native coverage reporting with PR comments.
- "Repository not found": Ensure repo is added to Coveralls.io
- "Invalid token": Check GITHUB_TOKEN permissions or use COVERALLS_REPO_TOKEN
- "No coverage data": Verify coverage.out file is generated correctly
- Badge not updating: May take a few minutes after successful upload
- Check GitHub Actions logs for Coveralls step
- Verify coverage.out file exists and contains data
- Check Coveralls.io repository page for recent builds
- Test with a simple PR to verify integration
- Simplified maintenance: No custom scripts or conversions
- Better reliability: Official action with regular updates
- Enhanced features: PR comments, coverage trends, notifications
- Future-proof: Supported by Coveralls team directly