1 | name: Tests
|
2 |
|
3 | on:
|
4 | push:
|
5 | branches:
|
6 | - master
|
7 | pull_request:
|
8 |
|
9 | jobs:
|
10 | unit-tests:
|
11 | name: Unit Tests
|
12 | runs-on: ubuntu-latest
|
13 |
|
14 | steps:
|
15 | - uses: actions/checkout@v1
|
16 |
|
17 | - uses: actions/setup-node@v1
|
18 | with:
|
19 | node-version: 12.x
|
20 |
|
21 | - id: yarn-cache
|
22 | run: echo "::set-output name=dir::$(yarn cache dir)"
|
23 |
|
24 | - uses: actions/cache@v1
|
25 | with:
|
26 | path: ${{ steps.yarn-cache.outputs.dir }}
|
27 | key: yarn-${{ hashFiles('**/yarn.lock') }}
|
28 | restore-keys: |
|
29 | yarn-
|
30 |
|
31 | - run: yarn
|
32 | - run: yarn test
|