forked from electron-userland/electron-builder
-
Notifications
You must be signed in to change notification settings - Fork 3
275 lines (242 loc) · 9.48 KB
/
Copy pathtest.yaml
File metadata and controls
275 lines (242 loc) · 9.48 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
name: Test
on:
push:
branches: [master]
pull_request:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
inputs:
rebuild-docker-images:
description: "Rebuild all Docker images"
default: false
type: "boolean"
workflow_call: # Allow this workflow to be called from other workflows
inputs:
rebuild-docker-images-call:
description: "Rebuild all Docker images"
required: true
type: boolean
permissions:
contents: read
env:
TEST_IMAGE_NODE_MAJOR_VERSION: 22
jobs:
check-if-docker-build:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
force-docker-build: ${{ steps.changes.outputs.docker == 'true' || steps.changes.outputs.workflow == 'true' }}
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Determine if Dockerfiles changed
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: |
docker:
- 'docker/**'
workflow:
- '.github/workflows/docker*'
run-docker-build:
needs: check-if-docker-build
if: |
always() &&
(needs.check-if-docker-build.outputs.force-docker-build == 'true' ||
inputs.rebuild-docker-images == 'true' || inputs.rebuild-docker-images == true ||
inputs.rebuild-docker-images-call == 'true' || inputs.rebuild-docker-images-call == true)
uses: ./.github/workflows/docker-build.yml
test-linux:
runs-on: ubuntu-22.04
timeout-minutes: 20
needs: [check-if-docker-build, run-docker-build]
# Wonky if-conditional to allow this step to run AFTER docker images are rebuilt OR if the build stage skipped and we want to use dockerhub registry for images
if: |
always() &&
needs.check-if-docker-build.result == 'success' &&
(needs.run-docker-build.result == 'success' || needs.run-docker-build.result == 'skipped')
strategy:
fail-fast: false
matrix:
testFiles:
- ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configurationValidationTest,filenameUtilTest,filesTest,globTest,httpExecutorTest,ignoreTest,macroExpanderTest,mainEntryTest,urlUtilTest,extraMetadataTest,linuxArchiveTest,linuxPackagerTest,HoistedNodeModuleTest,MemoLazyTest,HoistTest,ExtraBuildResourcesTest,utilTest
- snapTest,debTest,fpmTest,protonTest
- winPackagerTest,winCodeSignTest,webInstallerTest
- oneClickInstallerTest,assistedInstallerTest,packageManagerTest
- concurrentBuildsTest
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
- name: Setup Tests
uses: ./.github/actions/pretest
with:
cache-path: ~/.cache/electron
cache-key: v-35.7.5-linux-electron
- name: Download test-runner if exists
if: needs.run-docker-build.result == 'success'
id: download-test-runner-image
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: electron-builder-all-${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}
path: ${{ runner.temp }}
- name: Load test runner image if needed
if: needs.run-docker-build.result == 'success'
run: |
docker image load --input ${{ runner.temp }}/electron-builder-all-${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}.tar
docker image ls -a
- name: Lint
run: pnpm pretest
- name: Run tests in docker image
run: |
echo $TEST_RUNNER_IMAGE_TAG
pnpm test-linux
env:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1
TEST_RUNNER_IMAGE_TAG: electronuserland/builder:${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}-wine-mono
# Need to separate from other tests because logic is specific to when TOKEN env vars are set
test-updater:
runs-on: ubuntu-22.04
timeout-minutes: 20
needs: [check-if-docker-build, run-docker-build]
# Wonky if-conditional to allow this step to run AFTER docker images are rebuilt OR if the build stage skipped and we want to use dockerhub registry for images
if: |
always() &&
needs.check-if-docker-build.result == 'success' &&
(needs.run-docker-build.result == 'success' || needs.run-docker-build.result == 'skipped')
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Tests
uses: ./.github/actions/pretest
with:
cache-path: ~/.cache/electron
cache-key: v-35.7.5-update-electron
- name: Download test-runner if exists
if: needs.run-docker-build.result == 'success'
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: electron-builder-all-${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}
path: ${{ runner.temp }}
- name: Load test runner image if needed
if: needs.run-docker-build.result == 'success'
run: |
docker image load --input ${{ runner.temp }}/electron-builder-all-${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}.tar
docker image ls -a
- name: Lint
run: pnpm pretest
- name: Test
run: |
echo $TEST_RUNNER_IMAGE_TAG
pnpm test-linux
env:
TEST_FILES: nsisUpdaterTest,PublishManagerTest,differentialUpdateTest,GitlabPublisherTest,GitlabPublisher.integration.test
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
FORCE_COLOR: 1
TEST_RUNNER_IMAGE_TAG: electronuserland/builder:${{ env.TEST_IMAGE_NODE_MAJOR_VERSION }}-wine-mono
# must be it's own build node due to docker library/images size limit on github hosted runners
test-e2e:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Tests
uses: ./.github/actions/pretest
with:
cache-path: ~/.cache/electron
cache-key: v-35.7.5-update-electron
- name: Verify Docs Generation
run: pnpm generate-all
- name: e2e Linux Updater tests (install, auto-update, uninstall)
run: |
sh test/src/updater/test-specific-platforms.sh
test-windows:
runs-on: windows-2022
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
testFiles:
- winCodeSignTest,differentialUpdateTest,squirrelWindowsTest
- appxTest,msiTest,portableTest,assistedInstallerTest,protonTest
- BuildTest,oneClickInstallerTest,winPackagerTest,nsisUpdaterTest,webInstallerTest
- concurrentBuildsTest
- blackboxUpdateTest
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Tests
uses: ./.github/actions/pretest
with:
cache-key: v-35.7.5-windows-electron
cache-path: ~\AppData\Local\electron\Cache
- name: Test
run: pnpm ci:test
env:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1
# Some tests fails while on macOS 26, so we'll keep it this way for now
test-mac:
runs-on: macos-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
testFiles:
- oneClickInstallerTest,assistedInstallerTest,webInstallerTest,packageManagerTest,HoistedNodeModuleTest
- winPackagerTest,winCodeSignTest,BuildTest,blackboxUpdateTest
- masTest,dmgTest,filesTest,macPackagerTest,differentialUpdateTest,macArchiveTest
- concurrentBuildsTest
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Tests
uses: ./.github/actions/pretest
with:
cache-path: ~/Library/Caches/electron
cache-key: v-35.7.5-macos-electron
- name: Install toolset via brew
run: |
brew install powershell/tap/powershell
brew install --cask wine-stable
brew install rpm
- name: Test
run: pnpm ci:test
env:
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1
test-mac-26:
runs-on: macos-26
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
testFiles:
- macIconTest
steps:
- name: Checkout code repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Tests
uses: ./.github/actions/pretest
with:
cache-path: ~/Library/Caches/electron
cache-key: v-23.3.10-macos-electron
- name: Install toolset via brew
run: |
brew install powershell/tap/powershell
brew install --cask wine-stable
brew install rpm
- name: Test
run: pnpm ci:test
env:
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1