name: Build and Test on: push: branches: [develop, master] pull_request: branches: [master, develop] schedule: - cron: '23 4 * * 1' workflow_dispatch: inputs: gcc13_arm64: description: 'Also run GCC 13 ARM64 and its ASan/UBSan fast tests' type: boolean default: false repeat_desktop_tests: description: 'Also run the desktop matrix, repeating the complete CTest suite three times' type: boolean default: false permissions: contents: read concurrency: group: build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} # 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: # 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: 25 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" # 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 Catch2 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_MSVC_ANALYZE=ON -DWEBFRONT_BUILD_EXAMPLES=ON' || '-DWEBFRONT_MSVC_ANALYZE=OFF -DWEBFRONT_BUILD_EXAMPLES=OFF' }} ${{ matrix.options }} - name: Build run: python3 test/tools/MeasureCommand.py --output build/build-resources.json -- cmake --build build --config ${{ matrix.build_type }} --parallel 4 - 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 "${{ github.workspace }}/build/fast-results.xml" - name: Capture CTest dependency graph shell: bash run: ctest --test-dir build --show-only=json-v1 > build/ctest-graph.json - name: Test C++ and native browser integration # 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: >- python3 test/tools/MeasureCommand.py --output build/suite-resources.json -- cmake -DBUILD_DIR=build -DCONFIG=${{ matrix.build_type }} -DREPEAT=${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests)) && '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 - name: Repeat WebKitGTK pointer tests with suite display sharing enabled if: runner.os == 'Linux' env: ${{ matrix.test_env }} # These tests must still get private displays when invoked from the shared-display suite runner. run: >- xvfb-run -a env WEBFRONT_TEST_SHARED_DISPLAY=1 ctest --test-dir build --output-on-failure --no-tests=error -R '^WebKitGTKAdapter-(choose-file|cancel-choose|close-with-dialog)$' --repeat until-fail:5 - name: Analyze CTest timings if: always() shell: bash run: python3 test/tools/ProfileTests.py build/ctest-graph.json build/test-results-*.xml --workers 4 --log build/Testing/Temporary/LastTest.log --ninja-log build/.ninja_log --output build/test-profile.txt # 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 env: BENCHMARK_COVERAGE: ${{ github.event_name == 'workflow_dispatch' && inputs.repeat_desktop_tests }} run: | set -euo pipefail # lcov 2 on Ubuntu 26.04 rejects the benign line/function hit inconsistencies GCC emits for templates. if [[ "$BENCHMARK_COVERAGE" == true ]]; then /usr/bin/time -v -o coverage-pp-capture.txt lcov --rc lcov_json_module=JSON::PP --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage-pp.info fi perl -MJSON::XS -e 'print "Fast JSON backend JSON::XS $JSON::XS::VERSION\n"' /usr/bin/time -v -o coverage-capture.txt lcov --verbose --rc lcov_json_module=JSON::XS --ignore-errors inconsistent,inconsistent --gcov-tool gcov-16 --capture --directory . --output-file coverage.info 2>&1 | tee coverage-capture.log grep -F 'Using JSON module JSON::XS' coverage-capture.log if [[ "$BENCHMARK_COVERAGE" == true ]]; then python3 ../test/tools/CompareCoverage.py coverage-pp.info coverage.info fi /usr/bin/time -v -o coverage-filter.txt lcov --ignore-errors inconsistent,inconsistent --remove coverage.info '/usr/*' '*/examples/*' --output-file coverage.info /usr/bin/time -v -o coverage-list.txt 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/ctest-graph.json build/test/unit/consumer-build/.ninja_log build/test-profile* build/*-resources.json build/coverage-*.txt build/coverage-capture.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 timeout-minutes: 25 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 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 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