Merge pull request #4 from fspaniol/master #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Base coverage | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**.md" | |
jobs: | |
Coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12.18 | |
- name: Restore node_modules cache | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
- name: npm install | |
run: npm install | |
- name: Run tests with coverage | |
run: npm run test -- --coverage --collectCoverage=true --coverageDirectory="./" --coverageReporters="lcovonly" | |
- name: Rename coverage file | |
run: mv ./lcov.info ./base-coverage.lcov | |
- uses: actions/cache@v2 | |
with: | |
path: ./base-coverage.lcov | |
key: ${{ runner.os }}-master-coverage-${{ hashFiles('./base-coverage.lcov') }} | |
- name: Report code coverage | |
uses: eberlitz/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
lcov-file: ./base-coverage.lcov |