-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (38 loc) · 1.23 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
name: Tests
on:
push:
branches:
- master
pull_request:
jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
# fork to always run cache save, see https://github.com/actions/cache/issues/92
# Remove after https://github.com/actions/setup-node/pull/272 is launched
- name: Restore yarn cache
uses: bbugh/cache@c64c572235d810460d0d6876e9c705ad5002b353
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-v1-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-v1-yarn-
- run: yarn install --frozen-lockfile --prefer-offline
- name: xvfb-run -a yarn test (Linux)
run: xvfb-run -a yarn test
if: runner.os == 'Linux'
- name: yarn test (MacOS/Windows)
run: yarn test
if: runner.os != 'Linux'