forked from romeovs/lcov-reporter-action
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.15 KB
/
push-master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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