-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (71 loc) · 2.25 KB
/
nodeCI.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
74
name: Node CI
on: [push, pull_request, workflow_dispatch]
env:
FORCE_COLOR: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [16]
electron_version: [29, 30, 31, 32]
include:
- os: windows-latest
node: 16
command_prefix: ''
electron_version: 32
- os: ubuntu-latest
command_prefix: xvfb-run
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache dir
if: ${{ runner.os != 'Windows' }}
id: yarn-cache
shell: bash
run: |
echo "dir=~/$(realpath -s --relative-to="${HOME}" "$(yarn cache dir)")" >> "${GITHUB_OUTPUT}"
- name: Yarn cache
if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ matrix.os }}-yarn-node-${{ matrix.node }}-electron-${{ matrix.electron_version }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ matrix.os }}-yarn-node-${{ matrix.node }}-electron-${{ matrix.electron_version }}-
${{ matrix.os }}-yarn-node-${{ matrix.node }}-
${{ matrix.os }}-yarn-node-
save-always: true
- name: Electron version
id: electron-version
shell: bash
run: |
echo "$(jq -M '.devDependencies.electron = "^${{ matrix.electron_version }}.0.0"' -- package.json)" > package.json
cat package.json
- name: yarn install
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: yarn install
- name: yarn lint
run: yarn lint
- name: yarn test
uses: nick-fields/retry@v3
env:
ELECTRON_VERSION: ${{ matrix.electron_version }}
with:
timeout_minutes: 5
max_attempts: 3
command: ${{ matrix.command_prefix }} yarn run test:ci
- name: Upload coverage to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 16 && matrix.electron_version == 32 }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml