This GitHub Action posts your test suite's coverage data to coveralls.io for analysis, change tracking, and notifications. You don't need to add the repo to Coveralls first, it will be created when receiving the post.
When running on pull_request events, a comment will be added to the PR with details about how coverage will be affected if merged.
This action's step needs to run after your test suite has outputted a coverage report file. Most major test runners can be configured to do so, very likely with the addition of a test coverage library, such as simplecov for ruby, coverage.py for python, or istanbul or jest for javascript, etc.
- This example assumes you're building a Node project using the command
make test-coverage, demo here: nickmerwin/node-coveralls
on: ["push", "pull_request"]
name: Test Coveralls
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: npm install, make test-coverage
run: |
npm install
make test-coverage
- name: Coveralls
uses: coverallsapp/github-action@v2on: ["push", "pull_request"]
name: Test Coveralls Parallel
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
test_number:
- 1
- 2
steps:
- uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: npm install
run: npm install
- name: Test ${{ matrix.test_number }}
run: make test-coverage-${{ matrix.test_number }}
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "run-1,run-2"The "Coveralls Finished" step needs to run after all other steps have completed; it will let Coveralls know that all jobs in the build are done and aggregate coverage calculation can be calculated and notifications sent.
- A new function
fwithout test coverage is added. - The changes are committed and pushed to a new branch "function/f"
- The workflow runs on GitHub Actions.
- The commit on GitHub shows a new check for Coveralls with details "First build on function-f at 92.0%", and links to the Job on Coveralls.
- Line-by-line results indicate the new function is missing coverage.
- Create a pull request with the new branch.
- The
pull_requestcheck runs, and the resulting coverage data triggers afailstatus. - A detailed comment is posted.
Ensure that:
- Your workflow invokes the Coveralls action that runs on pull requests, e.g.:
on: ["push", "pull_request"]- You have invited the @coveralls user to your repository with
Role: Write - You have enabled the "LEAVE COMMENTS?" setting in the "Pull Request Alerts" area in your Repo Settings page inside the Coveralls app.
Ensure your workflow yaml line for the GitHub token matches exactly:
github-token: ${{ secrets.GITHUB_TOKEN }}Coveralls.io is always free for open-source projects!
Create a free account for your (public) repo at Coveralls, then use one of our official integrations—coverage-reporter, github-action (this project!), or orb—to upload your coverage reports to the Coveralls API.
Additionally, over 30 community-created language integrations exist for Coveralls.io.
Get started with our documentation here.
Issues or Questions? Reach out to us using GitHub issues, or at support@coveralls.io.
Bug reports and pull requests are welcome.
The gem is available as open source under the terms of the MIT License.
Contributors are expected to adhere to the Contributor Covenant code of conduct.


