-
Notifications
You must be signed in to change notification settings - Fork 67
162 lines (144 loc) · 3.99 KB
/
test.yml
File metadata and controls
162 lines (144 loc) · 3.99 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Test
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
SECRETS: ${{ toJSON(secrets) }}
ELECTRON_VERSION: 41.0.0
jobs:
linux:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: build-24
run_tests: true
run_electron_tests: false
- name: build-electron-41
run_tests: false
run_electron_tests: true
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
lfs: true
persist-credentials: false
fetch-depth: 0
- name: Install Linux build dependencies
run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
- name: Install Linux Electron runtime dependencies
if: matrix.run_electron_tests
run: sudo apt-get install -y libgtk-3-0 libxtst6 libxss1 libnss3 xvfb
- name: Setup Project
uses: ./.github/actions/setup-node-pnpm
- name: Build
run: |
GYP_ARGS=(
--runtime=electron
--target="${ELECTRON_VERSION}"
--dist-url=https://electronjs.org/headers
)
pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}"
- name: Run Tests
if: matrix.run_tests
run: pnpm test
- name: Run Electron Tests
if: matrix.run_electron_tests
env:
ELECTRON_DISABLE_SANDBOX: "true"
run: |
pnpm run pretest
xvfb-run -a pnpm exec electron-mocha --timeout 480000
macos:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: build-macos-24
runner: macos-15-intel
target_arch: ""
run_tests: true
- name: build-macos-24-arm64
runner: macos-15
target_arch: arm64
run_tests: false
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
lfs: true
persist-credentials: false
fetch-depth: 0
- name: Setup Project
uses: ./.github/actions/setup-node-pnpm
- name: Build
env:
TARGET_ARCH: ${{ matrix.target_arch }}
run: |
GYP_ARGS=(
--runtime=electron
--target="${ELECTRON_VERSION}"
--dist-url=https://electronjs.org/headers
)
if [[ -n "${TARGET_ARCH:-}" ]]; then
GYP_ARGS+=(--target_arch="${TARGET_ARCH}")
fi
pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}"
- name: Run Tests
if: matrix.run_tests
run: pnpm test
windows:
name: ${{ matrix.name }}
runs-on: windows-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: windows-24_x64
target_arch: ""
run_tests: true
- name: windows-24_arm64
target_arch: arm64
run_tests: false
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
lfs: true
persist-credentials: false
fetch-depth: 0
- name: Setup Project
uses: ./.github/actions/setup-node-pnpm
- name: Build
env:
TARGET_ARCH: ${{ matrix.target_arch }}
run: |
GYP_ARGS=(
--runtime=electron
--target="${ELECTRON_VERSION}"
--dist-url=https://electronjs.org/headers
)
if [[ -n "${TARGET_ARCH:-}" ]]; then
GYP_ARGS+=(--target_arch="${TARGET_ARCH}")
fi
pnpm exec node-pre-gyp rebuild package testpackage "${GYP_ARGS[@]}"
- name: Run Tests
if: matrix.run_tests
run: |
pnpm test
pnpm exec electron-mocha --timeout 480000