|
| 1 | +name: BGL Modern CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, develop, bgl2] |
| 6 | + paths: |
| 7 | + - 'libs/graph/modern/**' |
| 8 | + - '.github/workflows/bgl-modern-ci.yml' |
| 9 | + pull_request: |
| 10 | + branches: [main, develop] |
| 11 | + paths: |
| 12 | + - 'libs/graph/modern/**' |
| 13 | + - '.github/workflows/bgl-modern-ci.yml' |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +jobs: |
| 17 | + # =========================================================================== |
| 18 | + # GCC Tests (Linux) |
| 19 | + # =========================================================================== |
| 20 | + gcc: |
| 21 | + name: GCC ${{ matrix.gcc }} - ${{ matrix.build_type }} |
| 22 | + runs-on: ubuntu-24.04 |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + gcc: ['10', '11', '12', '13', '14'] |
| 27 | + build_type: [Release, Debug] |
| 28 | + include: |
| 29 | + - gcc: '10' |
| 30 | + install: g++-10 |
| 31 | + - gcc: '11' |
| 32 | + install: g++-11 |
| 33 | + - gcc: '12' |
| 34 | + install: g++-12 |
| 35 | + - gcc: '13' |
| 36 | + install: g++-13 |
| 37 | + - gcc: '14' |
| 38 | + install: g++-14 |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - name: Install GCC ${{ matrix.gcc }} |
| 44 | + run: | |
| 45 | + sudo apt-get update |
| 46 | + sudo apt-get install -y ${{ matrix.install }} |
| 47 | +
|
| 48 | + - name: Configure |
| 49 | + run: | |
| 50 | + cmake -S libs/graph/modern -B build \ |
| 51 | + -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \ |
| 52 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ |
| 53 | + -DBGL_MODERN_BUILD_TESTS=ON \ |
| 54 | + -DBGL_MODERN_BUILD_EXAMPLES=ON |
| 55 | +
|
| 56 | + - name: Build |
| 57 | + run: cmake --build build --parallel $(nproc) |
| 58 | + |
| 59 | + - name: Test |
| 60 | + run: ctest --test-dir build --output-on-failure |
| 61 | + |
| 62 | + # =========================================================================== |
| 63 | + # Clang Tests (Linux) |
| 64 | + # =========================================================================== |
| 65 | + clang: |
| 66 | + name: Clang ${{ matrix.clang }} - ${{ matrix.build_type }} |
| 67 | + runs-on: ubuntu-24.04 |
| 68 | + strategy: |
| 69 | + fail-fast: false |
| 70 | + matrix: |
| 71 | + clang: ['13', '14', '15', '16', '17', '18'] |
| 72 | + build_type: [Release, Debug] |
| 73 | + |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v4 |
| 76 | + |
| 77 | + - name: Install Clang ${{ matrix.clang }} |
| 78 | + run: | |
| 79 | + wget https://apt.llvm.org/llvm.sh |
| 80 | + chmod +x llvm.sh |
| 81 | + sudo ./llvm.sh ${{ matrix.clang }} |
| 82 | + sudo apt-get install -y libc++-${{ matrix.clang }}-dev libc++abi-${{ matrix.clang }}-dev |
| 83 | +
|
| 84 | + - name: Configure (libstdc++) |
| 85 | + run: | |
| 86 | + cmake -S libs/graph/modern -B build \ |
| 87 | + -DCMAKE_CXX_COMPILER=clang++-${{ matrix.clang }} \ |
| 88 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ |
| 89 | + -DBGL_MODERN_BUILD_TESTS=ON \ |
| 90 | + -DBGL_MODERN_BUILD_EXAMPLES=ON |
| 91 | +
|
| 92 | + - name: Build |
| 93 | + run: cmake --build build --parallel $(nproc) |
| 94 | + |
| 95 | + - name: Test |
| 96 | + run: ctest --test-dir build --output-on-failure |
| 97 | + |
| 98 | + # =========================================================================== |
| 99 | + # MSVC Tests (Windows) |
| 100 | + # =========================================================================== |
| 101 | + msvc: |
| 102 | + name: MSVC ${{ matrix.vs }} - ${{ matrix.build_type }} |
| 103 | + runs-on: ${{ matrix.os }} |
| 104 | + strategy: |
| 105 | + fail-fast: false |
| 106 | + matrix: |
| 107 | + include: |
| 108 | + - os: windows-2022 |
| 109 | + vs: '2022' |
| 110 | + generator: 'Visual Studio 17 2022' |
| 111 | + build_type: Release |
| 112 | + - os: windows-2022 |
| 113 | + vs: '2022' |
| 114 | + generator: 'Visual Studio 17 2022' |
| 115 | + build_type: Debug |
| 116 | + |
| 117 | + steps: |
| 118 | + - uses: actions/checkout@v4 |
| 119 | + |
| 120 | + - name: Configure |
| 121 | + run: | |
| 122 | + cmake -S libs/graph/modern -B build ` |
| 123 | + -G "${{ matrix.generator }}" ` |
| 124 | + -DBGL_MODERN_BUILD_TESTS=ON ` |
| 125 | + -DBGL_MODERN_BUILD_EXAMPLES=ON |
| 126 | +
|
| 127 | + - name: Build |
| 128 | + run: cmake --build build --config ${{ matrix.build_type }} --parallel |
| 129 | + |
| 130 | + - name: Test |
| 131 | + run: ctest --test-dir build --config ${{ matrix.build_type }} --output-on-failure |
| 132 | + |
| 133 | + # =========================================================================== |
| 134 | + # macOS Tests (AppleClang) |
| 135 | + # =========================================================================== |
| 136 | + macos: |
| 137 | + name: macOS ${{ matrix.os }} - ${{ matrix.build_type }} |
| 138 | + runs-on: ${{ matrix.os }} |
| 139 | + strategy: |
| 140 | + fail-fast: false |
| 141 | + matrix: |
| 142 | + os: [macos-14, macos-15] |
| 143 | + build_type: [Release, Debug] |
| 144 | + |
| 145 | + steps: |
| 146 | + - uses: actions/checkout@v4 |
| 147 | + |
| 148 | + - name: Configure |
| 149 | + run: | |
| 150 | + cmake -S libs/graph/modern -B build \ |
| 151 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ |
| 152 | + -DBGL_MODERN_BUILD_TESTS=ON \ |
| 153 | + -DBGL_MODERN_BUILD_EXAMPLES=ON |
| 154 | +
|
| 155 | + - name: Build |
| 156 | + run: cmake --build build --parallel $(sysctl -n hw.ncpu) |
| 157 | + |
| 158 | + - name: Test |
| 159 | + run: ctest --test-dir build --output-on-failure |
| 160 | + |
| 161 | + # =========================================================================== |
| 162 | + # Sanitizers (Linux) |
| 163 | + # =========================================================================== |
| 164 | + sanitizers: |
| 165 | + name: ${{ matrix.sanitizer }} Sanitizer |
| 166 | + runs-on: ubuntu-24.04 |
| 167 | + strategy: |
| 168 | + fail-fast: false |
| 169 | + matrix: |
| 170 | + sanitizer: [address, undefined, thread] |
| 171 | + |
| 172 | + steps: |
| 173 | + - uses: actions/checkout@v4 |
| 174 | + |
| 175 | + - name: Configure |
| 176 | + run: | |
| 177 | + cmake -S libs/graph/modern -B build \ |
| 178 | + -DCMAKE_CXX_COMPILER=clang++-18 \ |
| 179 | + -DCMAKE_BUILD_TYPE=Debug \ |
| 180 | + -DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer" \ |
| 181 | + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}" \ |
| 182 | + -DBGL_MODERN_BUILD_TESTS=ON |
| 183 | +
|
| 184 | + - name: Build |
| 185 | + run: cmake --build build --parallel $(nproc) |
| 186 | + |
| 187 | + - name: Test |
| 188 | + run: ctest --test-dir build --output-on-failure |
| 189 | + env: |
| 190 | + ASAN_OPTIONS: detect_leaks=1 |
| 191 | + UBSAN_OPTIONS: print_stacktrace=1 |
| 192 | + |
| 193 | + # =========================================================================== |
| 194 | + # Code Coverage |
| 195 | + # =========================================================================== |
| 196 | + coverage: |
| 197 | + name: Code Coverage |
| 198 | + runs-on: ubuntu-24.04 |
| 199 | + steps: |
| 200 | + - uses: actions/checkout@v4 |
| 201 | + |
| 202 | + - name: Install lcov |
| 203 | + run: sudo apt-get install -y lcov |
| 204 | + |
| 205 | + - name: Configure |
| 206 | + run: | |
| 207 | + cmake -S libs/graph/modern -B build \ |
| 208 | + -DCMAKE_CXX_COMPILER=g++-14 \ |
| 209 | + -DCMAKE_BUILD_TYPE=Debug \ |
| 210 | + -DCMAKE_CXX_FLAGS="--coverage" \ |
| 211 | + -DCMAKE_EXE_LINKER_FLAGS="--coverage" \ |
| 212 | + -DBGL_MODERN_BUILD_TESTS=ON |
| 213 | +
|
| 214 | + - name: Build |
| 215 | + run: cmake --build build --parallel $(nproc) |
| 216 | + |
| 217 | + - name: Test |
| 218 | + run: ctest --test-dir build --output-on-failure |
| 219 | + |
| 220 | + - name: Generate Coverage Report |
| 221 | + run: | |
| 222 | + lcov --capture --directory build --output-file coverage.info |
| 223 | + lcov --remove coverage.info '/usr/*' --output-file coverage.info |
| 224 | + lcov --list coverage.info |
0 commit comments