-
-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 1.64 KB
/
main-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
61
62
63
64
name: Main
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Node.js ${{ matrix.node-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Cache yarn cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Build project
run: yarn build
- name: Cache VS Code binaries
uses: actions/cache@v3
id: vscode-cache
with:
path: .vscode-test
key: ${{ runner.os }}-vscode-${{ hashFiles('e2e/jest-runner-vscode.config.js') }}
restore-keys: |
${{ runner.os }}-vscode-
- name: Download VS Code
run: yarn ci:download-vscode
- name: Run tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a yarn test
- name: Run tests (non-Linux)
if: runner.os != 'Linux'
run: yarn test