Repository navigation
710 lines (638 loc) · 26.1 KB
/
Copy pathmain.yml
File metadata and controls
710 lines (638 loc) · 26.1 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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
---
name: Fx Test Execution
run-name: ${{ github.actor }} is running smoke tests
on:
workflow_call:
inputs:
channel:
description: "Channel to run tests against"
default: "beta"
type: string
required: false
job_to_run:
required: true
type: string
is_pull_request:
description: "Is this a PR?"
default: false
type: boolean
test_set:
description: "Test set to run"
default: ''
required: false
type: string
dry_run:
description: "If true, skip downloads/installs/tests/uploads (safe dry run)"
required: false
type: boolean
default: false
trigger_event:
required: false
type: string
secrets:
TESTRAIL_BASE_URL:
required: false
TESTRAIL_API_KEY:
required: false
TESTRAIL_USERNAME:
required: false
SLACK_KEY:
required: false
GCP_CREDENTIAL:
required: false
GC_CREDENTIAL_STABILITY:
required: false
BQ_PROJECT:
required: false
CI_WAF_TOKEN:
required: false
workflow_dispatch:
inputs:
channel:
description: 'Firefox channel for the supplied candidate'
default: 'beta'
required: false
type: string
win_installer_link:
description: 'The link to the Windows installer (win64) for the Fx under test'
required: false
type: string
mac_installer_link:
description: 'The link to the macOS installer for the Fx under test'
required: false
type: string
linux_tarball_link:
description: 'The link to the Linux tarball (linux-x86_64) for the Fx under test'
required: false
type: string
firefox_version:
description: 'Optional Firefox version metadata for a manual run'
required: false
type: string
test_set:
description: 'Test set to run'
default: "smoke"
required: false
type: string
env:
FX_CHANNEL: ${{ inputs.channel }}
FX_VERSION: ${{ inputs.firefox_version }}
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
CI_WAF_TOKEN: ${{ secrets.CI_WAF_TOKEN }}
jobs:
Test-Windows:
if: ${{ inputs.job_to_run == 'Test-Windows' || inputs.win_installer_link }}
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Dry-run notice
if: ${{ inputs.dry_run == true }}
run: |
Write-Host "DRY_RUN enabled: skipping downloads, installs, tests and uploads in this job."
- name: Set up Python 3.13
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
with:
python-version: "3.13"
- name: Set CI Environment (Default)
shell: pwsh
run: |
"STARFOX_SPLIT=$env:TEST_SET" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"TESTRAIL_REPORT=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
env:
TEST_SET: ${{ inputs.test_set }}
- name: Set CI Environment (Manual)
if: ${{ inputs.win_installer_link && inputs.dry_run != true }}
shell: pwsh
run: |
"MANUAL=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"STARFOX_SPLIT=$env:TEST_SET" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "Running smoke tests on supplied executable"
env:
TEST_SET: ${{ inputs.test_set }}
- name: Set CI Environment (Scheduled Beta)
if: ${{ inputs.job_to_run == 'Test-Windows' && inputs.is_pull_request == false && inputs.dry_run != true }}
shell: pwsh
run: |
"TESTRAIL_REPORT=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "Running report for most recent Beta on Windows"
- name: Install dependencies
run: |
mkdir -p artifacts;
pip3 install 'uv==0.11.18';
uv sync;
uv run python scripts/switch_config.py ci;
uv sync;
- name: Install Fx
id: install-fx
env:
WIN_INSTALLER_LINK: ${{ inputs.win_installer_link }}
if: ${{ inputs.dry_run != true }}
shell: pwsh
run: |
if (-not $env:WIN_INSTALLER_LINK) {
$fx_url = (uv run python -m scripts.collect_executables) -join ""
if (-not $fx_url) { throw "collect_executables returned an empty Firefox URL" }
"FX_DOWNLOAD_URL=$fx_url" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
$gecko_url = (uv run python -m scripts.collect_executables -g) -join ""
if (-not $gecko_url) { throw "collect_executables returned an empty geckodriver URL" }
"GECKO_DOWNLOAD_URL=$gecko_url" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$fx_version = (uv run python -m scripts.collect_executables -n) -join ""
"FX_VERSION=$fx_version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Download Geckodriver
if: ${{ inputs.dry_run != true }}
shell: pwsh
run: |
Invoke-WebRequest -Uri $env:GECKO_DOWNLOAD_URL -OutFile "geckodriver.zip"
unzip geckodriver.zip
echo "$env:GITHUB_WORKSPACE" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Download Beta
if: ${{ !inputs.win_installer_link && inputs.dry_run != true }}
shell: pwsh
run: |
Invoke-WebRequest -Uri $env:FX_DOWNLOAD_URL -OutFile "${{ github.workspace }}\setup.exe"
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
- name: Download Executable
if: ${{ inputs.win_installer_link && inputs.dry_run != true }}
env:
WIN_INSTALLER_LINK: ${{ inputs.win_installer_link }}
FX_EXECUTABLE: 'C:\Program Files\Custom Firefox\firefox.exe'
shell: pwsh
run: |
if ($env:WIN_INSTALLER_LINK.Contains(".zip")) {
Write-Host "Downloading and unzipping file..."
Invoke-WebRequest -Uri "$env:WIN_INSTALLER_LINK" -OutFile "firefox.zip"
Expand-Archive -Path firefox.zip -PassThru
Move-Item -Path firefox\firefox -Destination "C:\Program Files\Custom Firefox" -Force -PassThru
Start-Process -FilePath $env:FX_EXECUTABLE -ArgumentList "--version" -Wait -NoNewWindow
} else {
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
Invoke-WebRequest -Uri "$env:WIN_INSTALLER_LINK" -OutFile "${{ github.workspace }}\setup.exe"
}
- name: Install Beta
if: ${{ inputs.dry_run != true }}
id: setup
env:
WIN_INSTALLER_LINK: ${{ inputs.win_installer_link }}
shell: pwsh
run: |
if (-not $env:WIN_INSTALLER_LINK -or -not $env:WIN_INSTALLER_LINK.Contains(".zip")) {
Start-Process -FilePath "${{ github.workspace }}\setup.exe" -ArgumentList "/S", '/D=C:\Program Files\Custom Firefox' -Wait -NoNewWindow -PassThru
}
- name: Select Tests (Win)
id: select
if: ${{ inputs.test_set != 'glean' }}
shell: pwsh
run: |
uv sync;
uv run python -m scripts.choose_test_split
- name: Print Selected Tests (Win)
if: ${{steps.select.conclusion == 'success'}}
shell: pwsh
run: |
$testCount = (Get-Content selected_tests | Where-Object { $_.Trim() -ne "" }).Count
Write-Host "Total test scripts selected: $testCount"
Write-Host "Selected tests: "
Get-Content selected_tests
- name: Test Fx Version (Win)
if: |-
${{
steps.setup.conclusion == 'success' &&
(steps.select.conclusion == 'success' || inputs.test_set == 'glean') &&
inputs.dry_run != true
}}
env:
TESTRAIL_REPORT: false
shell: pwsh
run: |
uv run python -c "import sys; print(sys.platform)"
$env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
Start-Process -FilePath $env:FX_EXECUTABLE -ArgumentList "--version" -Wait -NoNewWindow
uv run pytest ".\tests\meta\test_version.py" --geckodriver=geckodriver.exe
# --- REAL RUN: actually execute tests ---
- name: Run Tests in Win
if: |-
${{
steps.setup.conclusion == 'success' &&
steps.select.conclusion == 'success' &&
inputs.test_set != 'glean' &&
inputs.dry_run != true
}}
shell: pwsh
run: |
uv run pytest $(Get-Content selected_tests) --geckodriver=geckodriver.exe
$env:TEST_EXIT_CODE = $LASTEXITCODE
mv artifacts artifacts-win || true
exit $env:TEST_EXIT_CODE
- name: Run Glean Tests in Win
if: |-
${{
steps.setup.conclusion == 'success' &&
inputs.test_set == 'glean' &&
inputs.dry_run != true
}}
shell: pwsh
run: |
uv run pytest tests/glean --geckodriver=geckodriver.exe
$env:TEST_EXIT_CODE = $LASTEXITCODE
mv artifacts artifacts-win || true
exit $env:TEST_EXIT_CODE
env:
REPORTABLE: ${{ !inputs.is_pull_request }}
- name: Run Tests in Win (Headed)
if: |-
${{
steps.setup.conclusion == 'success' &&
inputs.test_set != 'glean' &&
always() &&
inputs.dry_run != true
}}
env:
REPORTABLE: true
shell: pwsh
run: |
uv sync;
uv run python scripts/switch_config.py ci_headed;
uv sync;
$env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
uv run pytest $(Get-Content selected_tests) --geckodriver=geckodriver.exe
$env:TEST_EXIT_CODE = $LASTEXITCODE
rm artifacts/assets -r -Force
Get-ChildItem -Path "artifacts" | ForEach-Object {
$destPath = "artifacts-win\" + $_.Name
if (-not (Test-Path -Path $destPath)) {
try {
Move-Item -Path $_.FullName -Destination $destPath
} catch {
# Ignore errors and continue
}
}
}
exit $env:TEST_EXIT_CODE
- name: Auth to Google Cloud
id: gcp_auth
if: ${{ always() && !inputs.is_pull_request && inputs.dry_run != true }}
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 3.0.0
with:
credentials_json: ${{ secrets.GC_CREDENTIAL_STABILITY }}
- name: Upload JSON to GCS Bucket
if: ${{ always() && inputs.trigger_event == 'schedule' && inputs.dry_run != true && steps.gcp_auth.conclusion == 'success' }}
uses: google-github-actions/upload-cloud-storage@6397bd7208e18d13ba2619ee21b9873edc94427a # v3.0.0
with:
path: artifacts-win
destination: 'fx-dte/artifacts/${{ github.run_id }}/win/'
glob: '**/*.json'
- name: Upload results to BigQuery
if: ${{ always() && steps.gcp_auth.conclusion == 'success' }}
env:
BQ_PROJECT: ${{ secrets.BQ_PROJECT }}
BQ_DATASET: fx_qa_ci
BQ_TABLE: test_results
GITHUB_RUN_STARTED_AT: ${{ github.run_started_at }}
BQ_WORKFLOW_FILE: main.yml
BQ_JOB_NAME: Test-Windows
BQ_TEST_SET: ${{ inputs.test_set }}
run: uv run python scripts/upload_results_to_bq.py
- name: Upload artifacts
if: ${{ always() && inputs.dry_run != true }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
with:
name: artifacts-win${{ inputs.test_set == 'glean' && '-glean' || '' }}
path: artifacts-win
- name: DLL Interceptor tests
id: dll
if: ${{ always() && !inputs.win_installer_link && inputs.dry_run != true && inputs.is_pull_request != true }}
env:
FX_EXECUTABLE: 'C:\Program Files\Custom Firefox\firefox.exe'
run: |
uv run python dll_check/check_dll_interceptors.py
Test-MacOS:
if: ${{ inputs.job_to_run == 'Test-MacOS' || inputs.mac_installer_link }}
runs-on: macos-26
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Dry-run notice
if: ${{ inputs.dry_run == true }}
run: |
echo "DRY_RUN enabled: skipping downloads, installs, tests and uploads in this job"
- name: Set up Python 3.13
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
with:
python-version: "3.13"
- name: Set CI Environment (Default)
run: |
echo "STARFOX_SPLIT=${TEST_SET}" >> "$GITHUB_ENV"
echo "TESTRAIL_REPORT=false" >> "$GITHUB_ENV"
env:
TEST_SET: ${{ inputs.test_set }}
- name: Check test case numbers
run: |
python scripts/check_test_cases.py
exit $?
- name: Set CI Environment (Scheduled Beta)
if: ${{ inputs.job_to_run == 'Test-MacOS' && inputs.is_pull_request == false && inputs.dry_run != true }}
run: |
echo "TESTRAIL_REPORT=true" >> "$GITHUB_ENV"
echo "Running report for most recent Beta on MacOS"
- name: Set CI Environment (Manual)
if: ${{ inputs.mac_installer_link && inputs.dry_run != true }}
run: |
echo "MANUAL=true" >> "$GITHUB_ENV"
echo "STARFOX_SPLIT=$TEST_SET" >> "$GITHUB_ENV"
echo "Running smoke tests on supplied executable"
env:
TEST_SET: ${{ inputs.test_set }}
- name: Install dependencies
id: setup
env:
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
run: |
mkdir -p artifacts;
pip install 'uv==0.11.18';
uv sync;
uv run python scripts/switch_config.py ci;
uv sync;
if ! [ "$MANUAL_DOWNLOAD_LINK" ]; then echo "FX_DOWNLOAD_URL=$(uv run python -m scripts.collect_executables)" >> "$GITHUB_ENV"; fi
echo "FX_VERSION=$(uv run python -m scripts.collect_executables -n)" >> "$GITHUB_ENV";
echo "GECKO_DOWNLOAD_URL=$(uv run python -m scripts.collect_executables -g)" >> "$GITHUB_ENV";
- name: Install Fx
id: install-fx
if: ${{ inputs.dry_run != true && steps.setup.conclusion == 'success'}}
env:
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
run:
echo "app_name=$(bash ./scripts/collect_executables.sh | xargs -0 ./scripts/parse_executables.sh)" >> "$GITHUB_OUTPUT";
- name: Select Tests (MacOS)
id: select
if: ${{ inputs.test_set != 'glean' }}
run: |
uv sync;
uv run python -m scripts.choose_test_split
- name: Print Selected Tests (MacOS)
if: ${{steps.select.conclusion == 'success'}}
run: |
test_count=$(grep -cve '^\s*$' selected_tests)
echo "Total test scripts selected: $test_count"
echo "Selected tests: "
cat selected_tests
- name: Test Fx Version (MacOS)
if: |-
${{
steps.install-fx.conclusion == 'success' &&
(steps.select.conclusion == 'success' || inputs.test_set == 'glean') &&
inputs.dry_run != true
}}
env:
FX_EXECUTABLE: /Volumes/${{ steps.install-fx.outputs.app_name }}/${{ steps.install-fx.outputs.app_name }}.app/Contents/MacOS/firefox
TESTRAIL_REPORT: false
run: |
"$FX_EXECUTABLE" --version
uv run pytest --fx-executable="$FX_EXECUTABLE" tests/meta/test_version.py || TEST_EXIT_CODE=$?
- name: Run Tests in MacOS
if: |-
${{
steps.install-fx.conclusion == 'success' &&
steps.select.conclusion == 'success' &&
inputs.test_set != 'glean' &&
inputs.dry_run != true
}}
env:
FX_EXECUTABLE: /Volumes/${{ steps.install-fx.outputs.app_name }}/${{ steps.install-fx.outputs.app_name }}.app/Contents/MacOS/firefox
run: |
"$FX_EXECUTABLE" --version
uv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
mv artifacts artifacts-mac || true
exit $TEST_EXIT_CODE
- name: Run Glean Tests in MacOS
if: |-
${{
steps.install-fx.conclusion == 'success' &&
inputs.test_set == 'glean' &&
inputs.dry_run != true
}}
env:
FX_EXECUTABLE: /Volumes/${{ steps.install-fx.outputs.app_name }}/${{ steps.install-fx.outputs.app_name }}.app/Contents/MacOS/firefox
REPORTABLE: ${{ !inputs.is_pull_request }}
run: |
"$FX_EXECUTABLE" --version
uv run pytest --fx-executable="$FX_EXECUTABLE" tests/glean || TEST_EXIT_CODE=$?
mv artifacts artifacts-mac || true
exit $TEST_EXIT_CODE
- name: Run Tests in MacOS (Headed)
if: |-
${{
steps.install-fx.conclusion == 'success' &&
inputs.test_set != 'glean' &&
always() &&
inputs.dry_run != true
}}
env:
FX_EXECUTABLE: /Volumes/${{ steps.install-fx.outputs.app_name }}/${{ steps.install-fx.outputs.app_name }}.app/Contents/MacOS/firefox
REPORTABLE: true
run: |
uv sync;
uv run python scripts/switch_config.py ci_headed
uv sync;
uv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
mv -n artifacts/* artifacts-mac/ || true
exit $TEST_EXIT_CODE
- name: Auth to Google Cloud
id: gcp_auth
if: ${{ always() && !inputs.is_pull_request && inputs.dry_run != true }}
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 3.0.0
with:
credentials_json: ${{ secrets.GC_CREDENTIAL_STABILITY }}
- name: Upload JSON to GCS Bucket
if: ${{ always() && inputs.trigger_event == 'schedule' && inputs.dry_run != true && steps.gcp_auth.conclusion == 'success' }}
uses: google-github-actions/upload-cloud-storage@6397bd7208e18d13ba2619ee21b9873edc94427a # v3.0.0
with:
path: artifacts-mac
destination: 'fx-dte/artifacts/${{ github.run_id }}/mac/'
glob: '**/*.json'
- name: Upload results to BigQuery
if: ${{ always() && steps.gcp_auth.conclusion == 'success' }}
env:
BQ_PROJECT: ${{ secrets.BQ_PROJECT }}
BQ_DATASET: fx_qa_ci
BQ_TABLE: test_results
GITHUB_RUN_STARTED_AT: ${{ github.run_started_at }}
BQ_WORKFLOW_FILE: main.yml
BQ_JOB_NAME: Test-MacOS
BQ_TEST_SET: ${{ inputs.test_set }}
run: uv run python scripts/upload_results_to_bq.py
- name: Upload artifacts
if: ${{ always() && inputs.dry_run != true }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
with:
name: artifacts-mac${{ inputs.test_set == 'glean' && '-glean' || '' }}
path: artifacts-mac
Smoke-Linux:
if: ${{ inputs.linux_tarball_link }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
with:
persist-credentials: false
- name: Set up Python 3.13
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
with:
python-version: "3.13"
- name: Set CI Environment (Default)
run: |
echo "STARFOX_SPLIT=${TEST_SET}" >> "$GITHUB_ENV"
echo "TESTRAIL_REPORT=false" >> "$GITHUB_ENV"
env:
TEST_SET: ${{ inputs.test_set }}
- name: Check test case numbers
run: |
python scripts/check_test_cases.py
exit $?
- name: Set CI Environment (Manual)
if: ${{ inputs.linux_tarball_link && inputs.dry_run != true }}
run: |
echo "MANUAL=true" >> "$GITHUB_ENV"
echo "STARFOX_SPLIT=$TEST_SET" >> "$GITHUB_ENV"
echo "Running smoke tests on supplied executable"
env:
TEST_SET: ${{ inputs.test_set }}
- name: Install dependencies
id: setup
env:
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
run: |
sudo apt install gnome-screenshot
uname -m;
mkdir -p artifacts;
pip3 install 'uv==0.11.18';
uv sync;
uv run python scripts/switch_config.py ci_xvfb;
uv sync;
echo "FX_VERSION=$(uv run python -m scripts.collect_executables -n)" >> "$GITHUB_ENV"
echo "GECKO_DOWNLOAD_URL=$(uv run python -m scripts.collect_executables -g)" >> "$GITHUB_ENV"
- name: Install executables
if: ${{ steps.setup.conclusion == 'success' }}
id: install-fx
env:
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
run: |
./scripts/collect_executables.sh
./firefox/firefox --version;
#. ./keyring-unlock.sh;
- name: Select Tests (Linux)
if: ${{ steps.install-fx.conclusion == 'success' }}
id: select
run: |
uv run python -m scripts.choose_test_split
env:
STARFOX_EXCLUDE: exclude_xvfb
- name: Run Smoke Tests in Ubuntu
if: ${{ steps.select.conclusion == 'success' && inputs.dry_run != true }}
env:
FX_EXECUTABLE: ./firefox/firefox
run: |
"$FX_EXECUTABLE" --version;
XVFB_PID=$(ps -e | grep vfb | head -1 | awk '{print $1}')
if [[ -n "$XVFB_PID" ]]; then kill -9 "$XVFB_PID"; fi;
xvfb-run -f "$HOME/.Xauthority" -s "-screen 0 1600x1200x24" uv run pytest --fx-executable="$FX_EXECUTABLE" --geckodriver=geckodriver $(cat selected_tests) || TEST_EXIT_CODE=$?;
mkdir -p artifacts-linux
mv -n artifacts/* artifacts-linux/ || true
exit $TEST_EXIT_CODE
- name: Run Smoke Tests in Ubuntu (Headed)
if: ${{ steps.install-fx.conclusion == 'success' && always() && inputs.dry_run != true }}
env:
FX_EXECUTABLE: ./firefox/firefox
REPORTABLE: true
run: |
uv sync;
uv run python scripts/switch_config.py ci_xvfb_headed;
uv sync;
XVFB_PID=$(ps -e | grep vfb | head -1 | awk '{print $1}')
if [[ -n "$XVFB_PID" ]]; then kill -9 "$XVFB_PID"; fi;
xvfb-run -f "$HOME/.Xauthority" -s "-screen 0 1600x1200x24" uv run pytest --fx-executable="$FX_EXECUTABLE" --geckodriver=geckodriver $(cat selected_tests) || TEST_EXIT_CODE=$?;
mkdir -p artifacts-linux
mv -n artifacts/* artifacts-linux/ || true
exit $TEST_EXIT_CODE
- name: Auth to Google Cloud
id: gcp_auth
if: ${{ always() && !inputs.is_pull_request && inputs.dry_run != true }}
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 3.0.0
with:
credentials_json: ${{ secrets.GC_CREDENTIAL_STABILITY }}
- name: Upload JSON to GCS Bucket
if: ${{ always() && inputs.dry_run != true && steps.gcp_auth.conclusion == 'success' }}
uses: google-github-actions/upload-cloud-storage@6397bd7208e18d13ba2619ee21b9873edc94427a # v3.0.0
with:
path: artifacts-linux
destination: 'fx-dte/artifacts/${{ github.run_id }}/linux/'
glob: '**/*.json'
- name: Upload results to BigQuery
if: ${{ always() && steps.gcp_auth.conclusion == 'success' }}
env:
BQ_PROJECT: ${{ secrets.BQ_PROJECT }}
BQ_DATASET: fx_qa_ci
BQ_TABLE: test_results
GITHUB_RUN_STARTED_AT: ${{ github.run_started_at }}
BQ_WORKFLOW_FILE: main.yml
BQ_JOB_NAME: Smoke-Linux
BQ_TEST_SET: ${{ inputs.test_set }}
run: uv run python scripts/upload_results_to_bq.py
- name: Upload artifacts
if: ${{ always() && inputs.dry_run != true }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
with:
name: artifacts-linux${{ inputs.test_set == 'glean' && '-glean' || '' }}
path: artifacts-linux
Use-Artifacts:
if: ${{ github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
needs:
- Test-Windows
- Test-MacOS
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
with:
persist-credentials: false
- name: Set up Python 3.13
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
with:
python-version: "3.13"
- name: Install dependencies
run: |
pip3 install 'uv==0.11.18'
uv sync
- name: Download Windows artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
with:
name: artifacts-win${{ inputs.test_set == 'glean' && '-glean' || '' }}
path: artifacts-win
- name: Download MacOS artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
with:
name: artifacts-mac${{ inputs.test_set == 'glean' && '-glean' || '' }}
path: artifacts-mac
- name: List downloaded Windows files
run: ls artifacts-win/
- name: List downloaded MacOS files
run: ls artifacts-mac/
- name: Run script with secret
env:
SLACK_KEY: ${{ secrets.SLACK_KEY }}
GCP_CREDENTIAL: ${{ secrets.GCP_CREDENTIAL }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_REF_NAME: ${{ github.ref_name }}
run: |
uv run python scripts/notifier.py