-
-
Notifications
You must be signed in to change notification settings - Fork 108
73 lines (59 loc) · 2.19 KB
/
test-win.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
65
66
67
68
69
70
71
72
73
name: Test for Windows
on:
- pull_request
- push
# concurrency:
# group: ${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }}
# cancel-in-progress: true
env:
YARN_VERSION: '^1.22.19'
jobs:
win-test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
node-version:
- '^16.18.1'
- '18.18.0'
steps:
# - name: Output concurrency group
# run: echo "${{ github.workflow }}-${{ (github.ref_name == 'main' && github.run_id) || format('{0}-{1}', github.actor, github.head_ref || github.ref_name) }}"
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install yarn
id: yarn
shell: bash
run: |
cd $HOME && yarn policies set-version $YARN_VERSION
echo "cache_dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn
uses: actions/cache@v3
with:
path: ${{ steps.yarn.outputs.cache_dir }}
key: yarn_cache-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn_cache-${{ runner.os }}-${{ matrix.node-version }}-
yarn_cache-${{ runner.os }}-
- name: Install dependencies with yarn
run: yarn install --frozen-lockfile
# Retry tests up to 3 times due to flaky tests on Windows CI
# https://stackoverflow.com/a/59365905
- name: Jest
run: >-
yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --forceExit ||
yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache ||
yarn test:coverage --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache
env:
CI: true
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: windows