-
Notifications
You must be signed in to change notification settings - Fork 1.9k
47 lines (45 loc) · 1.51 KB
/
companion.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
name: Companion
on:
push:
branches: [ main ]
pull_request:
# We want all branches so we configure types to be the GH default again
types: [ opened, synchronize, reopened ]
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.20.1, 12.x, 14.x, 16.x, 17.x]
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install Corepack if needed
run: corepack -v || npm install -g corepack
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: ${{matrix.node-version}}
- name: Install dependencies
run: corepack yarn install --immutable
env:
# Necessary for Node.js v10.x
NODE_OPTIONS: --experimental-worker
YARN_IGNORE_NODE: 1
- name: Run tests
run: corepack yarn run test:companion
env:
# Necessary for Node.js v10.x
NODE_OPTIONS: --experimental-worker
YARN_IGNORE_NODE: 1