-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (49 loc) · 1.53 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: [ master, development ]
pull_request:
branches: [ master, development ]
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: 31e81fa2e518d4b3ca9a0aeb7611c052a8e077098fdc795fe689332481e5b4d7
with:
coverageCommand: yarn coverage