Repository navigation
Automation: isolate each host's WebView2 profile and answer clients while the MCP listener closes #2575
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |