|
3 | 3 | branches:
|
4 | 4 | - master
|
5 | 5 |
|
6 |
| -env: |
7 |
| - BUILD_TYPE: Release |
8 |
| - |
9 | 6 | jobs:
|
10 | 7 | build:
|
| 8 | + strategy: |
| 9 | + matrix: |
| 10 | + compiler: [gcc, clang] |
| 11 | + build_type: [Debug, Release] |
| 12 | + lto_config: |
| 13 | + - lto: false |
| 14 | + full_lto: false |
| 15 | + - lto: true |
| 16 | + full_lto: false |
| 17 | + - lto: true |
| 18 | + full_lto: true |
| 19 | + exclude: |
| 20 | + # Don't try to build Debug with LTO enabled |
| 21 | + - build_type: Debug |
| 22 | + lto_config: |
| 23 | + lto: true |
| 24 | + # GCC doesn't have a thin LTO mode |
| 25 | + - compiler: gcc |
| 26 | + build_type: Release |
| 27 | + lto_config: |
| 28 | + lto: true |
| 29 | + full_lto: false |
| 30 | + |
| 31 | + env: |
| 32 | + CC: ${{ matrix.compiler }} |
| 33 | + CXX: ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }} |
| 34 | + LTO_CONFIG: ${{ matrix.build_type == 'Release' && format('-DNO_STF_LTO={0}', !matrix.lto_config.lto) || '' }} |
| 35 | + CLANG_FULL_LTO_CONFIG: ${{ (matrix.compiler == 'clang' && matrix.build_type == 'Release') && format('-DFULL_LTO={0}', matrix.lto_config.full_lto) || '' }} |
| 36 | + |
11 | 37 | runs-on: ubuntu-latest
|
12 | 38 |
|
13 | 39 | steps:
|
14 |
| - - uses: actions/checkout@v2 |
| 40 | + - uses: actions/checkout@v4 |
15 | 41 |
|
16 | 42 | - name: Install Dependencies
|
17 | 43 | run: |
|
18 | 44 | sudo apt-get update
|
19 |
| - sudo apt-get -y install libboost-dev |
| 45 | + sudo apt-get -y install libboost-dev cython3 |
| 46 | +
|
| 47 | + - name: Install Clang |
| 48 | + run: | |
| 49 | + sudo apt-get -y install clang lld llvm |
| 50 | + if: ${{ matrix.compiler == 'clang' }} |
20 | 51 |
|
21 | 52 | - name: Create Build Directory
|
22 | 53 | run: cmake -E make_directory ${{runner.workspace}}/build
|
23 | 54 |
|
24 | 55 | - name: Configure CMAKE
|
25 | 56 | working-directory: ${{runner.workspace}}/build
|
26 |
| - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
| 57 | + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_STF_PYTHON_LIB=ON $LTO_CONFIG $CLANG_FULL_LTO_CONFIG |
27 | 58 |
|
28 | 59 | - name: Build
|
29 | 60 | working-directory: ${{runner.workspace}}/build
|
30 |
| - run: cmake --build . --config $BUILD_TYPE |
| 61 | + run: cmake --build . --config ${{ matrix.build_type }} -j 4 |
31 | 62 |
|
32 | 63 | - name: Regress
|
33 | 64 | working-directory: ${{runner.workspace}}/build
|
34 |
| - run: cmake --build . --config $BUILD_TYPE --target regress |
| 65 | + run: cmake --build . --config ${{ matrix.build_type }} -j 4 --target regress |
0 commit comments