GitHub Action to post SimpleCov coverage on pull requests and fail when coverage is below a threshold.
- Reads coverage from
coverage/.last_run.jsonby default. - Supports both
result.covered_percentandresult.line. - Creates or updates one PR comment titled
Simplecov Report. - Fails the workflow if coverage is below
failedThreshold.
token: GitHub token (usually${{ secrets.GITHUB_TOKEN }}).failedThreshold: Minimum accepted coverage, default90.resultPath: Coverage file path, defaultcoverage/.last_run.json.
This action is intended for pull_request workflows.
name: test
on:
pull_request:
jobs:
rspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: bundle exec rspec
- name: Report SimpleCov
uses: codeur/simplecov-report-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
failedThreshold: 90
resultPath: coverage/.last_run.jsonLocal development commands:
npm installnpm run lintnpm run testnpm run packRun everything used in CI build job:
npm run all