-
-
Notifications
You must be signed in to change notification settings - Fork 111
66 lines (53 loc) · 2.03 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
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
jobs:
win-test:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
node-version:
- '^18.20.5'
- '^20.18.1'
- '22.12.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) }}"
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: |
npm ci
npx patch-package
- name: Set up LibreOffice
run: choco install libreoffice-fresh -y
# Retry tests up to 3 times due to flaky tests on Windows CI
# https://stackoverflow.com/a/59365905
- name: Jest
env:
MARP_TEST_CI: 1
run: >-
npm run test:coverage -- --ci --max-workers ${{ steps.cpu-cores.outputs.count }} --reporters=default --reporters=jest-junit ||
npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache ||
npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache ||
npm run test:coverage -- --ci -i --reporters=default --reporters=jest-junit --forceExit --no-cache
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.node-version }}
path: coverage
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: windows