This action comments a pull request with a test coverage report genreated using nyc.
Note: this action does not run any tests, but instead expects the tests to have been run by another action already.
Github token used for posting the comment. Add your token as a secret to repo in order to use: ${{ secrets.GITHUB_TOKEN }}
.
The reporter to use, by default it will use text-summary
reporter.
Folder where the coverage
folder is located.
Whether to use -t
flag when running the nyc command
Working directory option for nyc command
Folders to exclude on the report (string)
=============================== Coverage summary ===============================
Statements : 100% ( 9/9 )
Branches : 100% ( 0/0 )
Functions : 100% ( 4/4 )
Lines : 100% ( 8/8 )
================================================================================
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
----------|---------|----------|---------|---------|-------------------
name: 'Run tests'
on:
pull_request:
branches:
- '*'
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
check-latest: true
- run: npm install
- name: Run tests
run: npm run test
- uses: tintef/nyc-reporter-action
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPORTER: 'text' # defaults to 'text-summary'
- Add ability to delete previous comment and create a new one or update the old comment when a new a PR is updated.