|
| 1 | +# Pull-request and main-branch gate. |
| 2 | +# |
| 3 | +# The sweep is split into independent jobs so a failure names its own lane and the slow native lanes |
| 4 | +# run in parallel with the fast metadata ones. Within a job every gate step carries `if: always()`, |
| 5 | +# preserving the property `npm run check` has locally: these gates are independent, so stopping at |
| 6 | +# the first failure would hide the rest. |
| 7 | +# |
| 8 | +# The runtime lanes need no Node. Only the metadata gates and the pinned-compiler integration lane |
| 9 | +# do, and only the latter rehydrates a sibling checkout. |
| 10 | +name: CI |
| 11 | + |
| 12 | +on: |
| 13 | + pull_request: |
| 14 | + push: |
| 15 | + branches: [main] |
| 16 | + |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + |
| 20 | +concurrency: |
| 21 | + group: ci-${{ github.ref }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | +jobs: |
| 25 | + bazel-runtime: |
| 26 | + name: Bazel runtime (${{ matrix.os }}) |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + include: |
| 31 | + - os: ubuntu-latest |
| 32 | + toolchain_config: local-posix |
| 33 | + - os: macos-latest |
| 34 | + toolchain_config: local-posix |
| 35 | + - os: windows-latest |
| 36 | + toolchain_config: local-msvc |
| 37 | + runs-on: ${{ matrix.os }} |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + # setup-bazel 0.19.0 is pinned so the build bootstrap is reproducible as well as the Bazel version. |
| 41 | + - uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 |
| 42 | + with: |
| 43 | + bazelisk-cache: true |
| 44 | + cache-save: ${{ github.event_name != 'pull_request' }} |
| 45 | + disk-cache: bazel-runtime-${{ matrix.os }} |
| 46 | + repository-cache: true |
| 47 | + - name: Build and test runtime |
| 48 | + run: bazel --config=${{ matrix.toolchain_config }} --config=ci test //... |
| 49 | + - name: Run Bazel performance smoke gate |
| 50 | + if: matrix.os == 'ubuntu-latest' |
| 51 | + run: bazel --config=${{ matrix.toolchain_config }} --config=release test //benchmarks:runtime_benchmark |
| 52 | + |
| 53 | + cpp-runtime: |
| 54 | + name: C++ runtime (${{ matrix.compiler }}) |
| 55 | + strategy: |
| 56 | + fail-fast: false |
| 57 | + matrix: |
| 58 | + include: |
| 59 | + - compiler: GCC |
| 60 | + os: ubuntu-latest |
| 61 | + cmake-args: -DCMAKE_CXX_COMPILER=g++ -DFLIGHT_CPP_BUILD_BENCHMARKS=ON |
| 62 | + - compiler: GCC ASan+UBSan |
| 63 | + os: ubuntu-latest |
| 64 | + cmake-args: -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DFLIGHT_CPP_ENABLE_SANITIZERS=ON |
| 65 | + - compiler: Clang |
| 66 | + os: ubuntu-latest |
| 67 | + cmake-args: -DCMAKE_CXX_COMPILER=clang++ |
| 68 | + - compiler: Clang shared ABI |
| 69 | + os: ubuntu-latest |
| 70 | + cmake-args: -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=ON |
| 71 | + - compiler: AppleClang |
| 72 | + os: macos-latest |
| 73 | + cmake-args: -DCMAKE_CXX_COMPILER=clang++ |
| 74 | + - compiler: MSVC |
| 75 | + os: windows-latest |
| 76 | + cmake-args: '' |
| 77 | + - compiler: MSVC shared ABI |
| 78 | + os: windows-latest |
| 79 | + cmake-args: -DBUILD_SHARED_LIBS=ON |
| 80 | + runs-on: ${{ matrix.os }} |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + - name: Configure runtime |
| 84 | + run: cmake -S . -B build -DBUILD_TESTING=ON -DFLIGHT_CPP_WARNINGS_AS_ERRORS=ON -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake-args }} |
| 85 | + - name: Build runtime |
| 86 | + run: cmake --build build --config Release |
| 87 | + - name: Test runtime |
| 88 | + run: ctest --test-dir build --build-config Release --output-on-failure |
| 89 | + - name: Install runtime |
| 90 | + run: cmake --install build --config Release --prefix out/install |
| 91 | + - name: Configure installed consumer |
| 92 | + run: cmake -S tests/consumer -B out/consumer -DCMAKE_PREFIX_PATH=${{ github.workspace }}/out/install -DCMAKE_BUILD_TYPE=Release |
| 93 | + - name: Build installed consumer |
| 94 | + run: cmake --build out/consumer --config Release |
| 95 | + - name: Test installed consumer |
| 96 | + run: ctest --test-dir out/consumer --build-config Release --output-on-failure |
| 97 | + |
| 98 | + metadata: |
| 99 | + name: Release metadata gates |
| 100 | + runs-on: ubuntu-latest |
| 101 | + steps: |
| 102 | + - uses: actions/checkout@v4 |
| 103 | + - uses: actions/setup-node@v4 |
| 104 | + with: |
| 105 | + node-version: 22 |
| 106 | + - run: npm run abi:check |
| 107 | + if: always() |
| 108 | + - run: npm run build:check |
| 109 | + if: always() |
| 110 | + - run: npm run release:check |
| 111 | + if: always() |
| 112 | + |
| 113 | + pinned-compiler: |
| 114 | + name: Pinned compiler integration |
| 115 | + runs-on: ubuntu-latest |
| 116 | + steps: |
| 117 | + - uses: actions/checkout@v4 |
| 118 | + - uses: actions/setup-node@v4 |
| 119 | + with: |
| 120 | + node-version: 22 |
| 121 | + - name: Rehydrate pinned checkouts |
| 122 | + run: npm run rehydrate |
| 123 | + - name: Compile the pinned compiler's emitted C++ |
| 124 | + run: npm run compile:check |
0 commit comments