-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.1 KB
/
unit-tests.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
name: Test Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
coverage-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-modules-test-coverage-${{ hashFiles('package-lock.json') }}
- name: install
run: |
if [ ! -d "node_modules" ]; then # If we don't have any node_modules (CircleCI cache miss scenario), run yarn install --frozen-lockfile. Otherwise, we're all set, do nothing.
npm ci
fi
- run: npm run coverage
- name: publish test coverage to code climate
if: always() && env.CC_TEST_REPORTER_ID != ''
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage/lcov.info:lcov