forked from ipfs/ipfs-webui
-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (38 loc) · 1.3 KB
/
test-unit.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
on:
workflow_call:
jobs:
test-unit:
name: 'test:unit'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 16.12.0
- name: Setup [email protected]
run: |
npm install -g [email protected]
- name: Cache bigger downloads
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/.cache
key: ${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json') }}
${{ runner.os }}-
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm
- name: Run unit tests with coverage
run: npm run test:unit:coverage
- name: Generate nyc coverage report
id: coverage
run: npx nyc report --reporter=lcov
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit_tests # optional
name: unit-coverage # optional
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)