Attempt to speed up armv7 branch #10
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: ci | |
| on: | |
| push: | |
| branches: ["**"] | |
| tags-ignore: ["v*.*"] | |
| pull_request: | |
| branches: ["*"] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| CTEST_PARALLEL_LEVEL: 0 | |
| SNAP_ENABLE_COLOR: "1" | |
| jobs: | |
| lint: | |
| name: tier0 · lint + header smoke | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install tooling (apt) | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -yqq clang-tidy ninja-build cmake python3 | |
| - name: Run C/C++ linter (clang-tidy + clang-format) | |
| id: cpp-lint | |
| uses: cpp-linter/cpp-linter-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| style: file | |
| tidy-checks: '' | |
| thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} | |
| - name: Fail on lint findings | |
| if: steps.cpp-lint.outputs.checks-failed > 0 | |
| run: exit 1 | |
| - name: Configure + smoke tests (clang-fast) | |
| env: | |
| CC: clang-18 | |
| CXX: clang++-18 | |
| run: | | |
| sudo apt-get install -yqq clang-18 lld-18 | |
| cmake -E make_directory out/ci/smoke | |
| - name: Cache smoke build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| out/ci/smoke | |
| out/ci/smoke/CMakeCache.txt | |
| out/ci/smoke/CMakeFiles | |
| key: snap-smoke-${{ runner.os }}-${{ hashFiles('CMakePresets.json', 'tests/CMakeLists.txt', 'cmake/config/ProjectOptions.cmake') }} | |
| - name: Configure + build smoke | |
| env: | |
| CC: clang-18 | |
| CXX: clang++-18 | |
| run: | | |
| cmake -S . -B out/ci/smoke -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DCMAKE_CXX_STANDARD=20 \ | |
| -DSNAP_TEST_WERROR=ON | |
| cmake --build out/ci/smoke --parallel | |
| ctest --test-dir out/ci/smoke --label-regex smoke --output-on-failure --stop-on-failure | |
| tier1-posix: | |
| name: tier1 · host builds (${{ matrix.name }}) | |
| needs: lint | |
| runs-on: ${{ matrix.runs_on }} | |
| timeout-minutes: 50 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - name: linux-gcc-debug-cpp17 | |
| runs_on: ubuntu-24.04 | |
| configurePreset: ninja-gcc | |
| buildPreset: build-ninja-gcc-debug | |
| testPreset: test-ninja-gcc-debug | |
| buildDir: out/build/ninja/ninja-gcc | |
| cxxStandard: 17 | |
| cc: gcc-13 | |
| cxx: g++-13 | |
| packages: > | |
| ninja-build cmake gcc-13 g++-13 python3 | |
| toolchain: "" | |
| brew_packages: "" | |
| - name: linux-clang-release-cpp23 | |
| runs_on: ubuntu-24.04 | |
| configurePreset: ninja-clang | |
| buildPreset: build-ninja-clang-release | |
| testPreset: test-ninja-clang-release | |
| buildDir: out/build/ninja/ninja-clang | |
| cxxStandard: 23 | |
| cc: clang-18 | |
| cxx: clang++-18 | |
| packages: > | |
| ninja-build cmake clang-18 lld-18 python3 | |
| toolchain: "" | |
| brew_packages: "" | |
| - name: linux-clang-asan-cpp20 | |
| runs_on: ubuntu-24.04 | |
| configurePreset: ninja-clang-asan | |
| buildPreset: build-ninja-clang-asan-debug | |
| testPreset: test-ninja-clang-asan-debug | |
| buildDir: out/build/ninja/ninja-clang-asan | |
| cxxStandard: 20 | |
| cc: clang-18 | |
| cxx: clang++-18 | |
| packages: > | |
| ninja-build cmake clang-18 lld-18 python3 | |
| toolchain: "" | |
| brew_packages: "" | |
| - name: linux-arm64-clang-release-cpp23 | |
| runs_on: ubuntu-24.04-arm | |
| configurePreset: ninja-clang | |
| buildPreset: build-ninja-clang-release | |
| testPreset: test-ninja-clang-release | |
| buildDir: out/build/ninja/ninja-clang | |
| cxxStandard: 23 | |
| cc: clang-18 | |
| cxx: clang++-18 | |
| packages: > | |
| ninja-build cmake clang-18 lld-18 python3 | |
| toolchain: "" | |
| brew_packages: "" | |
| - name: macos-arm64-apple-clang-release-cpp20 | |
| runs_on: macos-15 | |
| configurePreset: ninja-clang | |
| buildPreset: build-ninja-clang-release | |
| testPreset: test-ninja-clang-release | |
| buildDir: out/build/ninja/ninja-clang | |
| cxxStandard: 20 | |
| cc: "" | |
| cxx: "" | |
| toolchain: apple-clang | |
| brew_packages: ninja | |
| - name: macos-arm64-llvm-clang-release-cpp23 | |
| runs_on: macos-15 | |
| configurePreset: ninja-clang | |
| buildPreset: build-ninja-clang-release | |
| testPreset: test-ninja-clang-release | |
| buildDir: out/build/ninja/ninja-clang | |
| cxxStandard: 23 | |
| cc: "" | |
| cxx: "" | |
| toolchain: llvm-clang | |
| brew_packages: "ninja llvm@18" | |
| - name: macos-arm64-gcc-debug-cpp20 | |
| runs_on: macos-15 | |
| configurePreset: ninja-gcc | |
| buildPreset: build-ninja-gcc-debug | |
| testPreset: test-ninja-gcc-debug | |
| buildDir: out/build/ninja/ninja-gcc | |
| cxxStandard: 20 | |
| cc: "" | |
| cxx: "" | |
| toolchain: gcc | |
| brew_packages: "ninja gcc@14" | |
| - name: macos-intel-clang-debug-cpp17 | |
| runs_on: macos-15-intel | |
| configurePreset: ninja-clang | |
| buildPreset: build-ninja-clang-debug | |
| testPreset: test-ninja-clang-debug | |
| buildDir: out/build/ninja/ninja-clang | |
| cxxStandard: 17 | |
| cc: "" | |
| cxx: "" | |
| toolchain: apple-clang | |
| brew_packages: ninja | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -yqq ${{ matrix.packages }} | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| env: | |
| HOMEBREW_NO_AUTO_UPDATE: 1 | |
| HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
| run: | | |
| if [[ -n "${{ matrix.brew_packages }}" ]]; then | |
| for pkg in ${{ matrix.brew_packages }}; do | |
| if ! brew list --versions "$pkg" >/dev/null 2>&1; then | |
| brew install "$pkg" | |
| else | |
| echo "brew package '$pkg' already installed" | |
| fi | |
| done | |
| fi | |
| - name: Configure macOS toolchain | |
| if: runner.os == 'macOS' | |
| run: | | |
| TOOL_DIR="$RUNNER_TEMP/snap-toolchain" | |
| mkdir -p "$TOOL_DIR" | |
| case "${{ matrix.toolchain }}" in | |
| llvm-clang) | |
| LLVM_PREFIX="$(brew --prefix llvm@18)" | |
| ln -sf "${LLVM_PREFIX}/bin/clang" "$TOOL_DIR/clang" | |
| ln -sf "${LLVM_PREFIX}/bin/clang++" "$TOOL_DIR/clang++" | |
| echo "$TOOL_DIR" >> "$GITHUB_PATH" | |
| echo "CC=clang" >> "$GITHUB_ENV" | |
| echo "CXX=clang++" >> "$GITHUB_ENV" | |
| ;; | |
| gcc) | |
| GCC_PREFIX="$(brew --prefix gcc@14)" | |
| ln -sf "${GCC_PREFIX}/bin/gcc-14" "$TOOL_DIR/gcc" | |
| ln -sf "${GCC_PREFIX}/bin/g++-14" "$TOOL_DIR/g++" | |
| echo "$TOOL_DIR" >> "$GITHUB_PATH" | |
| echo "CC=gcc" >> "$GITHUB_ENV" | |
| echo "CXX=g++" >> "$GITHUB_ENV" | |
| ;; | |
| apple-clang|"") | |
| echo "CC=clang" >> "$GITHUB_ENV" | |
| echo "CXX=clang++" >> "$GITHUB_ENV" | |
| ;; | |
| *) | |
| echo "Unknown macOS toolchain '${{ matrix.toolchain }}'" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| - name: Configure toolchain env | |
| if: ${{ matrix.cc != '' }} | |
| run: | | |
| echo "CC=${{ matrix.cc }}" >> "$GITHUB_ENV" | |
| echo "CXX=${{ matrix.cxx }}" >> "$GITHUB_ENV" | |
| - name: Cache build tree | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ matrix.buildDir }} | |
| key: snap-${{ runner.os }}-${{ matrix.name }}-${{ hashFiles('CMakePresets.json', 'tests/CMakeLists.txt', 'cmake/config/ProjectOptions.cmake') }} | |
| - name: Configure | |
| run: cmake --preset "${{ matrix.configurePreset }}" -DCMAKE_CXX_STANDARD=${{ matrix.cxxStandard }} | |
| - name: Build | |
| run: cmake --build --preset "${{ matrix.buildPreset }}" --parallel | |
| - name: Test | |
| run: ctest --preset "${{ matrix.testPreset }}" --output-on-failure --schedule-random -F | |
| tier1-windows: | |
| name: tier1 · windows builds (${{ matrix.name }}) | |
| needs: lint | |
| runs-on: windows-2022 | |
| timeout-minutes: 50 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - name: msvc-debug-cpp20 | |
| configurePreset: vs22 | |
| buildPreset: build-vs22-debug | |
| testPreset: test-vs22-debug | |
| cxxStandard: 20 | |
| - name: msvc-release-cpp23 | |
| configurePreset: vs22 | |
| buildPreset: build-vs22-release | |
| testPreset: test-vs22-release | |
| cxxStandard: 23 | |
| defaults: | |
| run: | |
| shell: pwsh | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache build tree | |
| uses: actions/cache@v4 | |
| with: | |
| path: out/build/vs22 | |
| key: snap-windows-${{ matrix.name }}-${{ hashFiles('CMakePresets.json', 'tests/CMakeLists.txt', 'cmake/config/ProjectOptions.cmake') }} | |
| - name: Configure | |
| run: cmake --preset "${{ matrix.configurePreset }}" -DCMAKE_CXX_STANDARD=${{ matrix.cxxStandard }} | |
| - name: Build | |
| run: cmake --build --preset "${{ matrix.buildPreset }}" --parallel | |
| - name: Test | |
| run: ctest --preset "${{ matrix.testPreset }}" --output-on-failure --schedule-random -F | |
| tier2-alt-arch: | |
| name: tier2 · linux (alt arch) smoke (${{ matrix.name }}) | |
| needs: | |
| - tier1-posix | |
| - tier1-windows | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 75 | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - name: aarch64-ubuntu24-clang | |
| arch: aarch64 | |
| distro: ubuntu24.04 | |
| std: 23 | |
| pkg: > | |
| git ninja-build cmake clang lld python3 | |
| cc: clang | |
| cxx: clang++ | |
| - name: riscv64-bookworm-gcc | |
| arch: riscv64 | |
| distro: bookworm | |
| std: 20 | |
| pkg: > | |
| git ninja-build cmake build-essential python3 | |
| cc: gcc | |
| cxx: g++ | |
| - name: ppc64le-ubuntu22-gcc | |
| arch: ppc64le | |
| distro: ubuntu22.04 | |
| std: 20 | |
| pkg: > | |
| git ninja-build cmake build-essential python3 | |
| cc: gcc | |
| cxx: g++ | |
| - name: s390x-ubuntu24-gcc | |
| arch: s390x | |
| distro: ubuntu24.04 | |
| std: 20 | |
| pkg: > | |
| git ninja-build cmake build-essential python3 | |
| cc: gcc | |
| cxx: g++ | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build + test | |
| uses: uraimo/run-on-arch-action@v2 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| distro: ${{ matrix.distro }} | |
| install: | | |
| apt-get update -qq | |
| DEBIAN_FRONTEND=noninteractive apt-get install -yqq ${{ matrix.pkg }} | |
| run: | | |
| cmake -S . -B out/build/${{ matrix.arch }} -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DCMAKE_C_COMPILER=${{ matrix.cc }} \ | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \ | |
| -DCMAKE_CXX_STANDARD=${{ matrix.std }} \ | |
| -DSNAP_TEST_GROUPED=ON | |
| cmake --build out/build/${{ matrix.arch }} --parallel | |
| ctest --test-dir out/build/${{ matrix.arch }} --label-regex smoke --output-on-failure --stop-on-failure | |
| tier2-armv7-cross: | |
| name: tier2 · linux (armv7 cross) smoke | |
| needs: | |
| - tier1-posix | |
| - tier1-windows | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 40 | |
| continue-on-error: true | |
| container: | |
| image: dockcross/linux-armv7:latest | |
| env: | |
| CC: arm-linux-gnueabihf-gcc | |
| CXX: arm-linux-gnueabihf-g++ | |
| ARMV7_SYSROOT: /usr/arm-linux-gnueabihf | |
| CMAKE_CROSSCOMPILING_EMULATOR: qemu-arm;-L;/usr/arm-linux-gnueabihf | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure + build | |
| run: | | |
| cmake -S . -B out/build/armv7-cross -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DCMAKE_CXX_STANDARD=20 \ | |
| -DCMAKE_SYSTEM_NAME=Linux \ | |
| -DCMAKE_C_COMPILER="${CC}" \ | |
| -DCMAKE_CXX_COMPILER="${CXX}" \ | |
| -DCMAKE_CROSSCOMPILING_EMULATOR="${CMAKE_CROSSCOMPILING_EMULATOR}" \ | |
| -DCMAKE_SYSROOT="${ARMV7_SYSROOT}" \ | |
| -DSNAP_TEST_GROUPED=ON | |
| cmake --build out/build/armv7-cross --parallel | |
| - name: Test smoke suite (qemu-arm) | |
| run: | | |
| ctest --test-dir out/build/armv7-cross --label-regex smoke --output-on-failure --stop-on-failure | |
| tier2-linux-distros: | |
| name: tier2 · linux (distro matrix) smoke (${{ matrix.name }}) | |
| needs: | |
| - tier1-posix | |
| - tier1-windows | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - name: debian-12-gcc | |
| image: debian:12-slim | |
| install: | | |
| apt-get update -qq | |
| DEBIAN_FRONTEND=noninteractive apt-get install -yqq git ninja-build cmake build-essential python3 | |
| cc: gcc | |
| cxx: g++ | |
| std: 20 | |
| - name: fedora-41-clang | |
| image: fedora:41 | |
| install: | | |
| dnf -y update | |
| dnf -y install git ninja-build cmake clang lld python3 | |
| cc: clang | |
| cxx: clang++ | |
| std: 23 | |
| - name: opensuse-156-gcc | |
| image: opensuse/leap:15.6 | |
| install: | | |
| zypper --non-interactive refresh | |
| zypper --non-interactive install git ninja cmake gcc gcc-c++ make python3 | |
| cc: gcc | |
| cxx: g++ | |
| std: 20 | |
| - name: alpine-320-gcc | |
| image: alpine:3.20 | |
| install: | | |
| apk add --no-cache build-base cmake ninja git python3 | |
| cc: gcc | |
| cxx: g++ | |
| std: 20 | |
| container: | |
| image: ${{ matrix.image }} | |
| steps: | |
| - name: Install base toolchain | |
| run: ${{ matrix.install }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure toolchain env | |
| run: | | |
| echo "CC=${{ matrix.cc }}" >> "$GITHUB_ENV" | |
| echo "CXX=${{ matrix.cxx }}" >> "$GITHUB_ENV" | |
| - name: Configure + build | |
| run: | | |
| cmake -S . -B out/build/distro/${{ matrix.name }} -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DCMAKE_CXX_STANDARD=${{ matrix.std }} \ | |
| -DSNAP_TEST_GROUPED=ON | |
| cmake --build out/build/distro/${{ matrix.name }} --parallel | |
| - name: Test smoke suite | |
| run: | | |
| ctest --test-dir out/build/distro/${{ matrix.name }} --label-regex smoke --output-on-failure --stop-on-failure | |
| tier2-bsd: | |
| name: tier2 · freebsd smoke | |
| needs: | |
| - tier1-posix | |
| - tier1-windows | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build + test (FreeBSD 14.2) | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| release: '14.2' | |
| usesh: true | |
| run: | | |
| pkg update -f | |
| pkg install -y cmake ninja llvm git | |
| cmake -S . -B out/build/freebsd -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_CXX_STANDARD=20 \ | |
| -DSNAP_TEST_GROUPED=ON | |
| cmake --build out/build/freebsd --parallel | |
| ctest --test-dir out/build/freebsd --label-regex smoke --output-on-failure --stop-on-failure | |
| tier2-windows-arm64: | |
| name: tier2 · windows arm64 build | |
| needs: | |
| - tier1-posix | |
| - tier1-windows | |
| runs-on: windows-2022 | |
| timeout-minutes: 45 | |
| continue-on-error: true | |
| defaults: | |
| run: | |
| shell: pwsh | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache build tree | |
| uses: actions/cache@v4 | |
| with: | |
| path: out/build/vs22-arm64 | |
| key: snap-windows-arm64-${{ hashFiles('CMakePresets.json', 'tests/CMakeLists.txt', 'cmake/config/ProjectOptions.cmake') }} | |
| - name: Configure (ARM64 cross) | |
| run: cmake --preset vs22-arm64 -DCMAKE_CXX_STANDARD=20 | |
| - name: Build (ARM64 Release) | |
| run: cmake --build --preset build-vs22-arm64-release --parallel | |
| - name: Note about tests | |
| run: Write-Host "ARM64 binaries are cross-compiled on x64 runners; runtime tests are unavailable on this host." | |