-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.65 KB
/
test.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
name: test
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Cancel running workflows
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Read node version
id: nvm
run: echo "::set-output name=version::$(cat .nvmrc)"
- name: Set node version
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.version }}
- name: Cache yarn version
id: yarn-cache
uses: actions/cache@v2
with:
path: '**/.yarn'
key: yarn-cache-${{ hashFiles('**/.yvmrc') }}
- name: Read yarn version
id: yvm
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: echo "::set-output name=version::$(cat .yvmrc)"
- name: Set yarn version
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn policies set-version ${{ steps.yvm.outputs.version }}
- name: Cache node_modules
id: node-modules-cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node-modules-cache-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test