16
16
type : string
17
17
workflow_dispatch :
18
18
inputs :
19
+ win_installer_link :
20
+ description : ' The link to the Windows installer (win64) for the Fx under test'
21
+ required : false
22
+ type : string
19
23
mac_installer_link :
20
24
description : ' The link to the macOS installer for the Fx under test'
21
25
required : false
@@ -118,7 +122,7 @@ jobs:
118
122
name : artifacts-mac
119
123
path : artifacts-mac
120
124
L10N-Linux :
121
- if : ${{ github.event_name == 'pull_request' || inputs.job_to_run == 'L10N-MacOS' || inputs.linux_tarball_link }}
125
+ if : ${{ inputs.linux_tarball_link }}
122
126
runs-on : ubuntu-latest
123
127
steps :
124
128
- name : Create app token
@@ -141,7 +145,7 @@ jobs:
141
145
MANUAL_DOWNLOAD_LINK : ${{ inputs.linux_tarball_link }}
142
146
run : |
143
147
echo "MANUAL='true'" >> "$GITHUB_ENV";
144
- echo "Running smoke tests on supplied executable";
148
+ echo "Running l10n tests on supplied executable";
145
149
sudo apt install gnome-screenshot
146
150
uname -m;
147
151
mkdir -p artifacts;
@@ -190,10 +194,149 @@ jobs:
190
194
fi
191
195
exit $SCRIPT_EXIT_CODE
192
196
197
+
198
+
199
+ L10N-Windows :
200
+ if : ${{ inputs.job_to_run == 'L10N-Windows' || github.event_name == 'pull_request' || inputs.win_installer_link }}
201
+ runs-on : windows-latest
202
+ steps :
203
+ - name : Create app token
204
+ uses : actions/create-github-app-token@v1
205
+ id : app-token
206
+ with :
207
+ app-id : ${{ secrets.BOT_CLIENT_ID }}
208
+ private-key : ${{ secrets.BOT_PRIVATE_KEY }}
209
+ - name : Checkout repository
210
+ uses : actions/checkout@v4
211
+ with :
212
+ token : ${{ steps.app-token.outputs.token }}
213
+ - name : Set up Python 3.11
214
+ uses : actions/setup-python@v5
215
+ with :
216
+ python-version : " 3.11"
217
+ - name : Set Environment (Manual)
218
+ if : ${{ inputs.win_installer_link }}
219
+ run : |
220
+ $env_contents = @"
221
+ MANUAL='true'
222
+ "@
223
+ New-item -Name .env -Value $env_contents -ItemType File -Force
224
+ Write-Host "Running l10n tests on supplied executable"
225
+ - name : Set Environment (Scheduled Beta)
226
+ if : ${{ inputs.job_to_run == 'Smoke-Windows' }}
227
+ run : |
228
+ $env_contents = @"
229
+ TESTRAIL_REPORT='true'
230
+ "@
231
+ New-item -Name .env -Value $env_contents -ItemType File -Force
232
+ Write-Host "Running report for most recent Beta on Windows"
233
+ Write-Host "$env:TESTRAIL_USERNAME"
234
+ - name : Install dependencies
235
+ run : |
236
+ mkdir -p artifacts;
237
+ pip3 install 'pipenv==2023.11.15';
238
+ pip3 install 'ruff>=0.4.8,<0.5';
239
+ rm ./pyproject.toml;
240
+ mv ./ci_pyproject.toml ./pyproject.toml;
241
+ pipenv install;
242
+ - name : Download Geckodriver
243
+ run : |
244
+ $gecko_url = (pipenv run python collect_executables.py -g) -join "`n"
245
+ echo $gecko_url
246
+ Invoke-WebRequest -Uri $gecko_url -OutFile "geckodriver.zip"
247
+ unzip geckodriver.zip
248
+ shell : pwsh
249
+ - name : Download Beta
250
+ if : ${{ !inputs.win_installer_link }}
251
+ run : |
252
+ $fx_url = (pipenv run python collect_executables.py) -join "`n"
253
+ echo $fx_url
254
+ Invoke-WebRequest -Uri $fx_url -OutFile "${{ github.workspace }}\setup.exe"
255
+ New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
256
+ shell : pwsh
257
+ - name : Download Executable
258
+ if : ${{ inputs.win_installer_link }}
259
+ run : |
260
+ Invoke-WebRequest -Uri ${{ inputs.win_installer_link }} -OutFile "${{ github.workspace }}\setup.exe"
261
+ New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
262
+ shell : pwsh
263
+ - name : Install Beta
264
+ id : setup
265
+ run : |
266
+ Start-Process -FilePath "${{ github.workspace }}\setup.exe" -ArgumentList "/S", '/D=C:\Program Files\Custom Firefox' -Wait -NoNewWindow -PassThru
267
+ shell : pwsh
268
+ - name : Run L10N Tests in Win
269
+ if : steps.setup.conclusion == 'success'
270
+ run : |
271
+ pipenv run python -c "import sys; print(sys.platform)"
272
+ $env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
273
+ Start-Process -FilePath $env:FX_EXECUTABLE -ArgumentList "--version" -Wait -NoNewWindow
274
+ pipenv run python check_l10n_test_cases.py
275
+ "0" | Set-Content -Path "TEST_EXIT_CODE"
276
+ $SCRIPT_EXIT_CODE = 0
277
+ Get-Content "selected_l10n_mappings" | ForEach-Object {
278
+ $line = $_
279
+ Write-Host "Running tests for: $line"
280
+ try {
281
+ pipenv run python l10n_CM/run_l10n.py --fx-executable="$env:FX_EXECUTABLE" $line
282
+ } catch {
283
+ $SCRIPT_EXIT_CODE = $_.Exception.HResult
284
+ }
285
+ }
286
+ mv artifacts artifacts-win || true
287
+ $EXIT_CODE = Get-Content -Path "TEST_EXIT_CODE"
288
+ if ($EXIT_CODE -ne 0) {
289
+ exit [int]$EXIT_CODE
290
+ }
291
+ exit $env:SCRIPT_EXIT_CODE
292
+ - name : Run L10N Tests in Win (Headed)
293
+ if : steps.setup.conclusion == 'success' && always()
294
+ env :
295
+ REPORTABLE : true
296
+ run : |
297
+ rm ./pyproject.toml;
298
+ mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
299
+ $env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
300
+ pipenv run python check_l10n_test_cases.py
301
+ "0" | Set-Content -Path "TEST_EXIT_CODE"
302
+ $SCRIPT_EXIT_CODE = 0
303
+ Get-Content "selected_l10n_mappings" | ForEach-Object {
304
+ $line = $_
305
+ Write-Host "Running tests for: $line"
306
+ try {
307
+ pipenv run python l10n_CM/run_l10n.py --fx-executable="$env:FX_EXECUTABLE" $line
308
+ } catch {
309
+ $SCRIPT_EXIT_CODE = $_.Exception.HResult
310
+ }
311
+ }
312
+ rm artifacts/assets -r -Force
313
+ Get-ChildItem -Path "artifacts" | ForEach-Object {
314
+ $destPath = "artifacts-win\" + $_.Name
315
+ if (-not (Test-Path -Path $destPath)) {
316
+ try {
317
+ Move-Item -Path $_.FullName -Destination $destPath
318
+ } catch {
319
+ # Ignore errors and continue
320
+ }
321
+ }
322
+ }
323
+ $EXIT_CODE = Get-Content -Path "TEST_EXIT_CODE"
324
+ if ($EXIT_CODE -ne 0) {
325
+ exit [int]$EXIT_CODE
326
+ }
327
+ exit $env:SCRIPT_EXIT_CODE
328
+ - name : Upload artifacts
329
+ if : ${{ always() && github.event_name == 'pull_request' }}
330
+ uses : actions/upload-artifact@v4
331
+ with :
332
+ name : artifacts-win
333
+ path : artifacts-win
334
+
193
335
Use-Artifacts :
194
336
if : ${{ github.event_name != 'workflow_dispatch' }}
195
337
runs-on : ubuntu-latest
196
338
needs :
339
+ - L10N-Windows
197
340
- L10N-MacOS
198
341
steps :
199
342
- name : Checkout repository
@@ -206,11 +349,18 @@ jobs:
206
349
run : |
207
350
pip3 install 'pipenv==2023.11.15'
208
351
pipenv install
352
+ - name : Download Windows artifact
353
+ uses : actions/download-artifact@v4
354
+ with :
355
+ name : artifacts-win
356
+ path : artifacts-win
209
357
- name : Download MacOS artifact
210
358
uses : actions/download-artifact@v4
211
359
with :
212
360
name : artifacts-mac
213
361
path : artifacts-mac
362
+ - name : List downloaded files
363
+ run : ls artifacts-win/
214
364
- name : List downloaded MacOS files
215
365
run : ls artifacts-mac/
216
366
- name : Run script with secret
@@ -222,4 +372,4 @@ jobs:
222
372
GITHUB_ACTOR : ${{ github.actor }}
223
373
GITHUB_REF_NAME : ${{ github.ref_name }}
224
374
run : |
225
- pipenv run python notifier.py
375
+ pipenv run python notifier.py
0 commit comments