-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.52 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: test
on:
pull_request:
push:
paths-ignore:
- '**.md'
env:
CI: true
jobs:
skip-duplicate-runs:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@ea548f2a2a08c55dcb111418ca62181f7887e297
with:
concurrent_skipping: 'same_content'
paths_ignore: '["**/*.md"]'
test:
needs: skip-duplicate-runs
if: ${{ needs.skip-duplicate-runs.outputs.should_skip != 'true' }}
name: 'node v${{ matrix.node-version }} on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node-version: [10, 12, 14]
steps:
- name: checkout
uses: actions/checkout@v2
- name: set up node v${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: get cache directory
id: get-yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)" # XXX don't single quote
- name: restore cache directory
id: restore-yarn-cache
uses: actions/cache@v2
with:
path: ${{ steps.get-yarn-cache.outputs.dir }}
key: ${{ matrix.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ matrix.os }}-yarn-
- name: install
run: yarn install --prefer-offline --frozen-lockfile
- name: test
run: yarn test