Repository navigation
756 lines (737 loc) · 39.1 KB
/
Copy pathBuildAndTest.yml
File metadata and controls
756 lines (737 loc) · 39.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
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
name: Build and Test
on:
push:
branches: [develop, master]
pull_request:
branches: [master, develop]
schedule:
- cron: '23 4 * * 1'
workflow_dispatch:
inputs:
jetson_orin:
description: 'Validate a trusted branch on the Jetson hardware runner (maintainer only)'
type: boolean
default: false
gcc13_arm64:
description: 'Also run GCC 13 ARM64 and its ASan/UBSan fast tests'
type: boolean
default: false
cef_arm64:
description: 'Also run the CEF linuxarm64 browser integration (GCC 13)'
type: boolean
default: false
webkitgtk_arm64:
description: 'Also run the WebKitGTK aarch64 browser integration (GCC 13)'
type: boolean
default: false
repeat_desktop_tests:
description: 'Also run the desktop matrix, repeating the complete CTest suite desktop_passes times'
type: boolean
default: false
desktop_passes:
description: 'Passes of the complete desktop suite when repeat_desktop_tests is set (20 qualifies a reliability fix)'
type: number
default: 3
permissions:
contents: read
concurrency:
group: build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ inputs.jetson_orin && 'jetson' || 'hosted' }}
# Never cancel a push to a release branch: its coverage upload must complete.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/.cache/CPM
SCCACHE_GHA_ENABLED: 'true'
# The full tier of the desktop jobs (weekly, pull requests into and pushes to master, manual dispatch with repeat_desktop_tests)
# also runs the MSVC code analysis and compiles the examples; a pull request into develop does neither (#435, docs/BUILD_TIME_STUDY.md).
FULL_TIER: ${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)) && 'true' || 'false' }}
# Third-party actions are pinned to commit SHAs; GitHub-owned actions/* use version tags.
jobs:
# Pre-merge entry point: the standalone workflow cannot be dispatched until it is on the default branch.
jetson-validation:
if: >-
github.repository == 'ambroise-leclerc/WebFront' && !cancelled() && github.event_name == 'workflow_dispatch' &&
github.actor == 'ambroise-leclerc' && github.ref_type == 'branch' && inputs.jetson_orin
runs-on: [self-hosted, linux, arm64, jetson-orin]
timeout-minutes: 180
concurrency:
group: jetson-orin
cancel-in-progress: false
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Build and test at low priority
run: nice -n 15 ionice -c 3 bash .github/scripts/jetson-orin.sh
- name: Retain diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: jetson-orin-${{ github.run_id }}
path: |
build-jetson-*/Testing/Temporary/LastTest.log
build-jetson-*/*results.xml
retention-days: 14
if-no-files-found: ignore
- name: Remove job build directories
if: always()
run: rm -rf -- build-jetson-core build-jetson-webkitgtk
# The Linux toolchain image is tagged with the hash of its Dockerfile and built only when that tag is missing from ghcr.io,
# so a change of the Dockerfile is validated by the very run that carries it. A pull request from a fork cannot push it
# (read-only token): its Linux job then fails at the pull, which a maintainer re-run on a branch of this repository fixes.
linux-image:
if: github.event_name != 'workflow_dispatch' || inputs.repeat_desktop_tests
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
packages: write
outputs:
image: ${{ steps.tag.outputs.image }}
steps:
- uses: actions/checkout@v7
- name: Name the image after its Dockerfile
id: tag
run: |
hash=$(sha256sum .github/docker/linux-ci.Dockerfile | cut -c1-16)
echo "image=ghcr.io/${GITHUB_REPOSITORY,,}/linux-ci:$hash" >> "$GITHUB_OUTPUT"
- name: Log in to ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Build and push the image if its tag does not exist
run: |
if docker manifest inspect "${{ steps.tag.outputs.image }}" > /dev/null 2>&1; then
echo "${{ steps.tag.outputs.image }} already exists"
else
docker build -f .github/docker/linux-ci.Dockerfile -t "${{ steps.tag.outputs.image }}" .github/docker
docker push "${{ steps.tag.outputs.image }}"
fi
desktop:
needs: linux-image
permissions:
contents: read
packages: read
# Only Linux waits for its image. Native desktops below start immediately and reuse these steps.
if: ${{ !cancelled() && (github.event_name != 'workflow_dispatch' || inputs.repeat_desktop_tests) }}
# No `name:` expression: a skipped matrix job would display it unevaluated.
timeout-minutes: ${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests && (inputs.desktop_passes > 3 && 300 || 90) || 60 }}
strategy:
fail-fast: false
matrix:
platform: [linux-gcc-webkitgtk]
include:
- platform: linux-gcc-webkitgtk
os: ubuntu-26.04
use_image: true
build_type: Debug
test_env: {WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS: '1'}
# GCC 16 compiles the optional C++26 reflection layer of the forms (#383): its tests must not be skipped here.
options: -DWEBFRONT_EMBED_WEBKITGTK=ON -DWEBFRONT_WEBTEST_FRONTEND=WebKitGTK -DWEBFRONT_ENABLE_COVERAGE=ON -DWEBFRONT_REQUIRE_REFLECTION_TESTS=ON
runs-on: ${{ matrix.os }}
# Only the Linux job runs in the prebuilt toolchain image; an empty value means no container.
container: ${{ matrix.use_image && fromJSON(format('{{"image":"{0}","credentials":{{"username":"{1}","password":"{2}"}},"options":"--shm-size=1g"}}', needs.linux-image.outputs.image, github.actor, github.token)) || '' }}
steps: &desktop-steps
- uses: actions/checkout@v7
with:
# A pull request is checked out as a merge commit: its first parent is the base, so the changed files are one diff away.
fetch-depth: 2
# The builds that prove the self-built environment reproducible and equal to the checked-in bundles take about 45 s. A
# pull request into develop that changes none of their inputs (what PrepareSelfBuildProject.cmake copies, and the CMake and
# workflow files that drive them) leaves them to the push to develop and to the master tier (#435).
- name: Decide whether the reproducibility builds run
shell: bash
run: |
reproducibility=true
if [ "$FULL_TIER" != true ] && [ "$GITHUB_EVENT_NAME" = pull_request ]; then
if ! git diff --name-only HEAD^1 HEAD | grep -qE '^(js/|examples/life/ui/|test/developer/|test/web/(CMakeLists\.txt|registry/)|test/cmake/(PrepareSelfBuildProject|CompareFiles|CheckSelfBuildRefresh|AssembleDeveloperFixtures)|include/webfront/system/|LICENSE$|\.github/workflows/BuildAndTest\.yml)'; then
reproducibility=false
fi
fi
echo "Reproducibility builds: $reproducibility"
echo "WEBFRONT_REPRODUCIBILITY=$reproducibility" >> "$GITHUB_ENV"
# The cases that configure a CMake project (label `configuration`, about 75 s of worker time on Windows) test the build
# system: a pull request into develop runs them only when it changes the build system or this workflow. A push to
# develop and the full tier always run them.
- name: Decide whether the configuration checks run
shell: bash
run: |
configuration=true
if [ "$FULL_TIER" != true ] && [ "$GITHUB_EVENT_NAME" = pull_request ]; then
if ! git diff --name-only HEAD^1 HEAD | grep -qE '^(cmake/|CMakeLists\.txt|js/core/[^/]*\.cmake|test/cmake/|test/unit/CMakeLists\.txt|\.github/actions/|\.github/workflows/BuildAndTest\.yml)'; then
configuration=false
fi
fi
echo "Configuration checks: $configuration"
echo "WEBFRONT_CONFIGURATION=$configuration" >> "$GITHUB_ENV"
# The MSVC code analysis (/analyze, about 22 % of a Windows build) belongs to the full tier, so a warning of the analyzer
# in Windows-only code went unseen in pull requests into develop until the release pull request (#628). A pull request into
# develop that changes Windows code (the PTY, the Windows frontends, any file named for Windows) runs it too. A cached
# build replays the compiler's diagnostics, so the cache never hides a warning; the tier did.
- name: Decide whether the MSVC analysis runs
shell: bash
run: |
analysis=$FULL_TIER
if [ "$FULL_TIER" != true ] && [ "$GITHUB_EVENT_NAME" = pull_request ]; then
if git diff --name-only HEAD^1 HEAD | grep -iE '^(include/webfront/components/pty/|include/webfront/frontend/WebView2|cmake/WebView2|cmake/CompilerWarnings|\.github/workflows/BuildAndTest\.yml)|windows|win32' > /dev/null; then
analysis=true
fi
fi
echo "MSVC analysis: $analysis"
echo "WEBFRONT_MSVC_ANALYSIS=$analysis" >> "$GITHUB_ENV"
# No step of a build or of its tests needs a JavaScript runtime or package manager: the runner has none from here on.
- uses: ./.github/actions/remove-node
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
# In the container the workspace is mounted elsewhere than the host path that `github.workspace` expands to.
- name: Point the CPM cache at the workspace
if: matrix.use_image
run: echo "CPM_SOURCE_CACHE=$GITHUB_WORKSPACE/.cache/CPM" >> "$GITHUB_ENV"
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake', 'test/unit/CMakeLists.txt') }}
restore-keys: cpm-${{ runner.os }}-
- uses: actions/cache@v4
with:
path: |
build/bootstrap
build/registry-archives
key: inputs-desktop-${{ runner.os }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }}
- name: Initialize MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
# GCC 16, WebKitGTK, lcov, Ninja and Xvfb come from the container image (.github/docker/linux-ci.Dockerfile).
- name: Setup Xcode
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
with:
xcode-version: latest
- name: Verify compiler cache launcher
shell: bash
run: |
command -v sccache
sccache --version
# ENABLE_CACHE controls automatic ccache discovery; the explicit sccache launcher stays enabled.
# The heavy unit tests are compiled four to a file (docs/BUILD_TIME_STUDY.md); the portability and sanitizer jobs keep one object per test file.
# No job relies on a default of the test options: the defaults are those of a quick local build (docs/TEST_TIERS.md).
# The unit tests run as four shards instead of one process per scenario (docs/TEST_TIERS.md).
- name: Configure
run: >-
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_ENABLE_TESTING=ON
-DENABLE_CACHE=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_SCAN_FOR_MODULES=OFF
-DWEBFRONT_TEST_UNITY_BATCH=4
-DWEBFRONT_TEST_UNIT_SHARDS=4
-DWEBFRONT_TEST_REPRODUCIBILITY=${{ env.WEBFRONT_REPRODUCIBILITY }}
${{ env.FULL_TIER == 'true' && '-DWEBFRONT_BUILD_EXAMPLES=ON' || '-DWEBFRONT_BUILD_EXAMPLES=OFF' }}
-DWEBFRONT_MSVC_ANALYZE=${{ env.WEBFRONT_MSVC_ANALYSIS == 'true' && 'ON' || 'OFF' }}
${{ matrix.options }}
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 4 ${{ runner.os == 'Windows' && '-- -k 0' || '' }}
- name: Ensure WebView2 Evergreen runtime
if: runner.os == 'Windows'
shell: pwsh
run: |
function Get-WebView2Runtime {
$runtimeRoots = @("${env:ProgramFiles(x86)}/Microsoft/EdgeWebView/Application", "$env:LOCALAPPDATA/Microsoft/EdgeWebView/Application")
$runtimeRoots | Where-Object { Test-Path $_ } | ForEach-Object { Get-ChildItem $_ -Filter msedgewebview2.exe -Recurse }
}
$runtime = Get-WebView2Runtime
if (-not $runtime) {
$installer = Join-Path $env:RUNNER_TEMP 'WebView2EvergreenBootstrapper.exe'
# Evergreen intentionally follows Microsoft's mutable bootstrapper redirect.
Invoke-WebRequest 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' -OutFile $installer
$signature = Get-AuthenticodeSignature -LiteralPath $installer
if ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notmatch '(?:^|,\s*)O=Microsoft Corporation(?:,|$)') {
throw 'WebView2 bootstrapper must have a valid Microsoft signature'
}
$install = Start-Process $installer -ArgumentList '/silent', '/install' -Wait -PassThru -WindowStyle Hidden
if ($install.ExitCode -ne 0) { throw "WebView2 runtime installation failed: $($install.ExitCode)" }
$runtime = Get-WebView2Runtime
}
if (-not $runtime) { throw 'WebView2 runtime executable not found after provisioning' }
foreach ($executable in $runtime) {
$version = $executable.VersionInfo.FileVersion
if (-not $version) { throw "WebView2 runtime version is missing: $($executable.FullName)" }
Write-Host "WebView2 runtime $version at $($executable.FullName)"
}
# The fast tier (docs/TEST_TIERS.md): unit tests only, so a plain regression is reported before the browser suite starts.
- name: Fast tests
shell: bash
run: >-
ctest --test-dir build -C ${{ matrix.build_type }} -L fast ${{ env.WEBFRONT_CONFIGURATION != 'true' && '-LE configuration' || '' }}
--parallel 4 --output-on-failure --no-tests=error --output-junit "$PWD/build/fast-results.xml"
- name: Test C++ and native browser integration
id: desktop_suite
# The fast tier has just run: a single pass does not run it again; the three passes of the complete tier do.
# Only Linux trusted fixtures need the sandbox opt-out on hosted runners.
env: ${{ matrix.test_env }}
run: >-
cmake -DBUILD_DIR=build -DCONFIG=${{ matrix.build_type }}
-DREPEAT=${{ (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests) && inputs.desktop_passes || ((github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master')) && '3' || '1') }}
'-DLABEL_EXCLUDE=${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)) && 'none' || (env.WEBFRONT_CONFIGURATION == 'true' && '^(portability|fast)$' || '^(portability|fast|configuration)$') }}'
-P test/cmake/RunTestSuite.cmake
# Nothing consumes the capture of a pull request, which only lists it in its log: it runs on a push to develop or master
# and in the full tier. The pull request still builds and runs the instrumented tests.
- name: Collect coverage
if: runner.os == 'Linux' && (github.event_name == 'push' || env.FULL_TIER == 'true')
shell: bash
working-directory: build
run: |
set -euo pipefail
# lcov 2 on Ubuntu 26.04 rejects the benign line/function hit inconsistencies GCC emits for templates.
lcov --rc lcov_json_module=JSON::XS --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage.info
lcov --ignore-errors inconsistent,inconsistent --remove coverage.info '/usr/*' '*/examples/*' --output-file coverage.info
lcov --list coverage.info
- name: Collect macOS browser crash diagnostics
if: failure() && runner.os == 'macOS'
timeout-minutes: 1
shell: bash
run: |
mkdir -p build/diagnostics
/usr/bin/log show --last 15m --style compact \
--predicate 'process CONTAINS "WebKit" OR process == "developer_integration"' \
> build/diagnostics/webkit.log 2>&1 || true
shopt -s nullglob
for directory in "$HOME/Library/Logs/DiagnosticReports" /Library/Logs/DiagnosticReports; do
for report in "$directory"/*WebKit* "$directory"/*WebContent* "$directory"/*developer_integration*; do
if [ -f "$report" ]; then cp "$report" build/diagnostics/; fi
done
done
- name: Compiler cache statistics
if: always()
shell: bash
run: sccache --show-stats
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-${{ runner.os }}
path: |
build/test-results-*.xml
build/fast-results.xml
build/unit-results-*.xml
build/test/unit/consumer-build/.ninja_log
build/Testing/Temporary/LastTest*.log
build/diagnostics/
if-no-files-found: ignore
desktop-native:
if: github.event_name != 'workflow_dispatch' || inputs.repeat_desktop_tests
permissions:
contents: read
# The explicit qualification includes a cold analysis build and desktop_passes complete graphs.
timeout-minutes: ${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests && (inputs.desktop_passes > 3 && 300 || 90) || 60 }}
strategy:
fail-fast: false
matrix:
platform: [windows-msvc-webview2, macos-clang-wkwebview]
include:
- platform: windows-msvc-webview2
os: windows-2025
build_type: Release
test_env: {}
options: -DWEBFRONT_EMBED_WEBVIEW2=ON -DWEBFRONT_WEBTEST_FRONTEND=WebView2
- platform: macos-clang-wkwebview
os: macos-26
build_type: Release
test_env: {}
options: -DWEBFRONT_EMBED_WKWEBVIEW=ON -DWEBFRONT_WEBTEST_FRONTEND=WKWebView
runs-on: ${{ matrix.os }}
steps: *desktop-steps
# Portability tier: the library consumed from another project, across generators and compilers, with a cold compiler cache.
# It runs weekly and on pull requests into master, where it is a required check (docs/TEST_TIERS.md).
portability:
if: github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)
name: portability (${{ matrix.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
include:
- {name: linux-gcc-ninja, os: ubuntu-24.04, generator: Ninja}
- {name: linux-clang-makefiles, os: ubuntu-24.04, generator: Unix Makefiles, clang: true}
- {name: windows-msvc-ninja, os: windows-2025, generator: Ninja}
- {name: macos-appleclang-ninja, os: macos-26, generator: Ninja}
# Not yet exercised on a hosted runner: reported, never blocking.
- {name: windows-msvc-visual-studio, os: windows-2025, generator: Visual Studio 18 2026, experimental: true}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/remove-node
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-extended-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: cpm-extended-${{ runner.os }}-
- name: Initialize MSVC environment
if: runner.os == 'Windows' && matrix.generator == 'Ninja'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
- name: Install Clang 23
if: matrix.clang
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-23 lld-23
echo "CC=clang-23" >> "$GITHUB_ENV"
echo "CXX=clang++-23" >> "$GITHUB_ENV"
- name: Report the selected compiler
shell: bash
run: |
if [ "$RUNNER_OS" = Windows ]; then cl 2>&1 || true; else "${CXX:-c++}" --version; fi
# No compiler cache: a new user compiles everything.
- name: Configure
shell: bash
run: cmake -S . -B build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_ENABLE_TESTING=ON -DENABLE_CACHE=OFF -DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DWEBFRONT_TEST_UNITY_BATCH=0 -DWEBFRONT_MSVC_ANALYZE=ON -DWEBFRONT_TEST_REPRODUCIBILITY=ON
- name: Portability tests
shell: bash
run: ctest --test-dir build -C Release -L portability --output-on-failure --no-tests=error
# GCC 13 on Linux aarch64 (#548): the default compiler of Ubuntu 24.04, JetPack 7.2 and Yocto Scarthgap, on the architecture of
# the Jetson boards. It builds the library, the examples and every test with the hosted ubuntu-24.04-arm image, then runs the fast
# tier. Warnings are not errors here: libstdc++ 13 reports false -Wnull-dereference positives (#526), so -Werror stays with the
# reference compiler (#525). A browser frontend needs a display and CEF has no aarch64 job yet, so both are off.
gcc13-arm64:
if: github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && (inputs.repeat_desktop_tests || inputs.gcc13_arm64))
runs-on: ubuntu-24.04-arm
timeout-minutes: 60
env:
CC: gcc-13
CXX: g++-13
ASAN_OPTIONS: detect_leaks=1:abort_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/remove-node
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-extended-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: cpm-extended-${{ runner.os }}-${{ runner.arch }}-
- name: Install GCC 13
run: |
sudo apt-get update
sudo apt-get install -y g++-13 ninja-build
# An image change must not move the compiler silently: fail unless this really is GCC 13 on aarch64.
- name: Verify the compiler
run: |
g++-13 --version
test "$(uname -m)" = aarch64
case "$(g++-13 -dumpfullversion)" in 13.*) ;; *) echo "::error::Expected GCC 13, got $(g++-13 -dumpfullversion)"; exit 1 ;; esac
- name: Configure
run: >-
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_EMBED_WEBKITGTK=OFF -DWEBFRONT_ENABLE_TESTING=ON
-DWARNINGS_AS_ERRORS=OFF -DENABLE_CACHE=OFF -DCMAKE_CXX_SCAN_FOR_MODULES=OFF
- name: Build
run: cmake --build build --parallel 4
- name: Fast tests
run: ctest --test-dir build -L fast --output-on-failure --no-tests=error --parallel 4
# Exercise coroutine lifetimes with the oldest supported compiler as well (#525).
- name: Configure GCC 13 ASan and UBSan
env:
WEBFRONT_TEST_TIMEOUT_FACTOR: '2'
run: >-
cmake -S . -B build-sanitizers -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_EMBED_WEBKITGTK=OFF -DWEBFRONT_ENABLE_TESTING=ON
-DWEBFRONT_BUILD_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF -DENABLE_CACHE=OFF
-DCMAKE_CXX_SCAN_FOR_MODULES=OFF
-DWEBFRONT_ENABLE_SANITIZER_ADDRESS=ON -DWEBFRONT_ENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON
- name: Build GCC 13 sanitizer tests
run: cmake --build build-sanitizers --parallel 2
- name: GCC 13 sanitizer fast tests
run: ctest --test-dir build-sanitizers -L fast --output-on-failure --no-tests=error --parallel 4
- name: Retain GCC 13 test diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-gcc13-arm64
path: |
build/Testing/Temporary/LastTest.log
build-sanitizers/Testing/Temporary/LastTest.log
if-no-files-found: ignore
# CEF on Linux aarch64 (#524): the pinned CEF picks its linuxarm64 archive from the target, so the browser integration suite runs
# natively on the hosted arm runner with GCC 13 and Xvfb, once a week (on demand with cef_arm64), not on every pull request.
# A Jetson Orin Nano qualification passed the same cases as x86-64; this job guards against drift.
cef-arm64:
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.cef_arm64)
timeout-minutes: 60
runs-on: ubuntu-24.04-arm
env:
CC: gcc-13
CXX: g++-13
steps:
- uses: actions/checkout@v7
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-extended-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: cpm-extended-${{ runner.os }}-${{ runner.arch }}-
- uses: actions/cache@v4
with:
path: |
build-cef/bootstrap
build-cef/registry-archives
key: inputs-web-integration-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }}
- uses: ./.github/actions/remove-node
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- name: Install GCC 13 and Xvfb
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends g++-13 ninja-build xvfb
- name: Verify the compiler
run: |
test "$(uname -m)" = aarch64
case "$(g++-13 -dumpfullversion)" in 13.*) ;; *) echo "::error::Expected GCC 13, got $(g++-13 -dumpfullversion)"; exit 1 ;; esac
- name: Configure CEF integration build
run: >-
cmake -S . -B build-cef -G Ninja -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=ON -DWEBFRONT_BUILD_EXAMPLES=OFF
-DWEBFRONT_ENABLE_TESTING=ON -DWARNINGS_AS_ERRORS=OFF -DENABLE_CACHE=OFF -DCMAKE_CXX_SCAN_FOR_MODULES=OFF
# The suite must not pass against an x86-64 archive by accident.
- name: Verify the CEF architecture
run: |
lib="$(find build-cef/_deps/cef_binaries-src -name libcef.so -print -quit)"
test -n "$lib"
file "$lib" | grep -q aarch64 || { echo "::error::CEF is not linuxarm64: $(file "$lib")"; exit 1; }
- name: Build browser test
run: cmake --build build-cef --target webtest developer_integration webfront-wf --parallel 4
- name: Run Jasmine bridge test
run: >-
ctest --test-dir build-cef -L web-integration --output-on-failure --no-tests=error --parallel 2
--output-junit "${{ github.workspace }}/build-cef/test-results.xml"
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-cef-arm64
path: |
build-cef/test-results.xml
build-cef/Testing/Temporary/LastTest.log
if-no-files-found: ignore
# WebKitGTK 6.0 on Linux aarch64 (#524): the system WebKitGTK of Ubuntu 24.04 with GCC 13 and Xvfb, running the same
# web-integration suite as the CEF job through the WebKitGTK frontend. Weekly and on demand with webkitgtk_arm64, not on
# pull requests, like the CEF job; the sandbox opt-out is confined to this test step and its trusted fixtures.
webkitgtk-arm64:
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.webkitgtk_arm64)
timeout-minutes: 60
runs-on: ubuntu-24.04-arm
env:
CC: gcc-13
CXX: g++-13
steps:
- uses: actions/checkout@v7
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-extended-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: cpm-extended-${{ runner.os }}-${{ runner.arch }}-
- uses: actions/cache@v4
with:
path: |
build-webkitgtk/bootstrap
build-webkitgtk/registry-archives
key: inputs-webkitgtk-arm64-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }}
- uses: ./.github/actions/remove-node
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- name: Install GCC 13, WebKitGTK and Xvfb
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends g++-13 ninja-build xvfb libwebkitgtk-6.0-dev
- name: Verify the compiler
run: |
test "$(uname -m)" = aarch64
case "$(g++-13 -dumpfullversion)" in 13.*) ;; *) echo "::error::Expected GCC 13, got $(g++-13 -dumpfullversion)"; exit 1 ;; esac
pkg-config --modversion webkitgtk-6.0
- name: Configure WebKitGTK integration build
run: >-
cmake -S . -B build-webkitgtk -G Ninja -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_EMBED_WEBKITGTK=ON
-DWEBFRONT_WEBTEST_FRONTEND=WebKitGTK -DWEBFRONT_BUILD_EXAMPLES=OFF -DWEBFRONT_ENABLE_TESTING=ON
-DWARNINGS_AS_ERRORS=OFF -DENABLE_CACHE=OFF -DCMAKE_CXX_SCAN_FOR_MODULES=OFF
- name: Build browser test
run: cmake --build build-webkitgtk --target webtest developer_integration webfront-wf --parallel 4
- name: Run Jasmine bridge test
env:
WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS: '1'
run: >-
ctest --test-dir build-webkitgtk -L web-integration --output-on-failure --no-tests=error --parallel 2
--output-junit "${{ github.workspace }}/build-webkitgtk/test-results.xml"
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-webkitgtk-arm64
path: |
build-webkitgtk/test-results.xml
build-webkitgtk/Testing/Temporary/LastTest.log
if-no-files-found: ignore
sanitizers:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.base_ref == 'master')
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
sanitizer: [address-undefined, thread]
env:
CC: clang-23
CXX: clang++-23
ASAN_OPTIONS: detect_leaks=1:abort_on_error=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
TSAN_OPTIONS: halt_on_error=1:second_deadlock_stack=1:suppressions=${{ github.workspace }}/test/sanitizers/tsan.supp
steps:
- uses: actions/checkout@v7
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-extended-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: cpm-extended-${{ runner.os }}-
- uses: actions/cache@v4
with:
path: |
build-sanitizers/bootstrap
build-sanitizers/registry-archives
key: inputs-sanitizers-${{ runner.os }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }}
- uses: ./.github/actions/remove-node
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Verify compiler cache launcher
run: sccache --version
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- name: Install Clang 23 and sanitizer runtimes
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-23 libclang-rt-23-dev libc++-23-dev libc++abi-23-dev zlib1g-dev
- name: Restrict address-space randomization for ThreadSanitizer
if: matrix.sanitizer == 'thread'
run: sudo sysctl vm.mmap_rnd_bits=28
# libc++ keeps retry-after-exception in call_once usable under TSan.
- name: Configure hardened sanitizer tests
run: >-
cmake -S . -B build-sanitizers -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DWEBFRONT_EMBED_CEF=OFF -DWEBFRONT_BUILD_EXAMPLES=OFF -DWEBFRONT_ENABLE_TESTING=ON -DENABLE_CACHE=OFF
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_SCAN_FOR_MODULES=OFF
-DWEBFRONT_TEST_UNITY_BATCH=0 -DWEBFRONT_TEST_REPRODUCIBILITY=ON
${{ matrix.sanitizer == 'thread' && '-DCMAKE_CXX_FLAGS=-stdlib=libc++ -DWEBFRONT_ENABLE_SANITIZER_THREAD=ON' || '-DWEBFRONT_ENABLE_SANITIZER_ADDRESS=ON -DWEBFRONT_ENABLE_SANITIZER_UNDEFINED_BEHAVIOR=ON -DWEBFRONT_ENABLE_FUZZING=ON -DWEBFRONT_GZIP_DIFFERENTIAL=ON' }}
- name: Build
run: cmake --build build-sanitizers --parallel 2
- name: Run full CEF-off suite
run: >-
ctest --test-dir build-sanitizers --output-on-failure --no-tests=error --parallel 4
--output-junit "${{ github.workspace }}/build-sanitizers/test-results.xml"
- name: Compare generated gzip streams against zlib
timeout-minutes: 5
if: matrix.sanitizer == 'address-undefined'
run: |
python3 test/fuzz/GenerateGzipCorpus.py build-sanitizers/gzip-corpus
build-sanitizers/test/unit/gzip_differential build-sanitizers/gzip-corpus
- name: Compiler cache statistics
if: always()
shell: bash
run: sccache --show-stats
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-${{ matrix.sanitizer }}
path: |
build-sanitizers/test-results.xml
build-sanitizers/Testing/Temporary/LastTest.log
if-no-files-found: ignore
- name: Fuzz decoders (30 seconds each)
if: matrix.sanitizer == 'address-undefined'
shell: bash
run: |
python3 test/fuzz/RunFuzzers.py build-sanitizers/test/fuzz --jobs 2 --seconds 30
- name: Upload fuzz findings
if: failure() && matrix.sanitizer == 'address-undefined'
uses: actions/upload-artifact@v4
with:
name: fuzz-findings
path: build-sanitizers/test/fuzz/artifacts/
if-no-files-found: ignore
web-integration:
timeout-minutes: 30
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.base_ref == 'master')
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
runs-on: ubuntu-24.04
# Clang 19+ expands stdexec attributes that GCC leaves empty, so only Clang catches CEF macro clashes (#243)
steps:
- uses: actions/checkout@v7
- uses: actions/cache@v4
with:
path: .cache/CPM
key: cpm-extended-${{ runner.os }}-${{ hashFiles('CMakeLists.txt', 'cmake/*.cmake') }}
restore-keys: cpm-extended-${{ runner.os }}-
- uses: actions/cache@v4
with:
path: |
build-cef/bootstrap
build-cef/registry-archives
key: inputs-web-integration-${{ runner.os }}-${{ hashFiles('cmake/WebFrontBootstrap.cmake', 'test/web/registry-packages.json') }}
- uses: ./.github/actions/remove-node
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- name: Verify compiler cache launcher
run: sccache --version
- uses: ./.github/actions/setup-cmake
with:
version: '4.4.4'
- name: Install Clang 23
if: matrix.compiler == 'clang'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-23 lld-23
echo "CC=clang-23" >> "$GITHUB_ENV"
echo "CXX=clang++-23" >> "$GITHUB_ENV"
# The registry packages and the pinned bootstrap environment are downloaded and verified here; wf then builds the rest.
- name: Configure CEF integration build
run: cmake . -B ${{github.workspace}}/build-cef -DCMAKE_BUILD_TYPE=Release -DWEBFRONT_EMBED_CEF=ON -DWEBFRONT_BUILD_EXAMPLES=OFF -DWEBFRONT_ENABLE_TESTING=ON -DWEBFRONT_TEST_REPRODUCIBILITY=ON -DENABLE_CACHE=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_SCAN_FOR_MODULES=OFF
- name: Build browser test
run: cmake --build ${{github.workspace}}/build-cef --target webtest developer_integration webfront-wf --parallel 2
# Everything is provisioned by the configure step: the tests must not reach the public network.
- name: Cut the public network
run: |
sudo iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT ! -o lo -j REJECT
sudo ip6tables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo ip6tables -A OUTPUT ! -o lo -j REJECT
- name: Run Jasmine bridge test
run: >-
ctest --test-dir ${{github.workspace}}/build-cef -L web-integration --output-on-failure --no-tests=error --parallel 4
--output-junit "${{ github.workspace }}/build-cef/test-results.xml"
- name: Restore the network
if: always()
run: |
sudo iptables -F OUTPUT
sudo ip6tables -F OUTPUT
- name: Compiler cache statistics
if: always()
shell: bash
run: sccache --show-stats
- name: Retain test timings and diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-log-cef-${{ matrix.compiler }}
path: |
build-cef/test-results.xml
build-cef/Testing/Temporary/LastTest.log
if-no-files-found: ignore