-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.51 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Unit Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
# install dependencies and run test command
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: npm install -g yarn
- name: Install dependencies
run: yarn
- name: Run test command
run: yarn test
coverage:
needs: [ test ]
name: Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@master
with:
node-version: '12'
- run: npm install -g yarn
- run: yarn install
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 82a2e54f7658ad1fe30fe06846391e8fa5007111b082e75df4468f84fa503b8d
with:
coverageCommand: yarn coverage