|
| 1 | +name: linux-modules |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-24.04 |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + cxx: [ g++-14, g++-15, clang++-16, clang++-17] |
| 14 | + build_type: [ Debug, Release ] |
| 15 | + std: [17, 20] |
| 16 | + include: |
| 17 | + - cxx: g++-14 |
| 18 | + install: sudo apt-get install g++-14 |
| 19 | + - cxx: g++-15 |
| 20 | + install: sudo apt-get install g++-15 |
| 21 | + - cxx: clang++-16 |
| 22 | + install: sudo apt-get install clang-16 libc++-16-dev libc++abi-16-dev |
| 23 | + - cxx: clang++-16 |
| 24 | + cxxflags: -stdlib=libc++ |
| 25 | + install: sudo apt-get install clang-16 libc++-16-dev libc++abi-16-dev |
| 26 | + - cxx: clang++-17 |
| 27 | + install: sudo apt-get install clang-17 libc++-17-dev libc++abi-17-dev |
| 28 | + - cxx: clang++-17 |
| 29 | + cxxflags: -stdlib=libc++ |
| 30 | + install: sudo apt-get install clang-17 libc++-17-dev libc++abi-17-dev |
| 31 | + |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 34 | + |
| 35 | + - name: Set timezone |
| 36 | + run: sudo timedatectl set-timezone 'Europe/Kyiv' |
| 37 | + |
| 38 | + - name: Add repositories for newer GCC |
| 39 | + run: | |
| 40 | + sudo apt-add-repository ppa:ubuntu-toolchain-r/test |
| 41 | +
|
| 42 | + - name: Add Ubuntu mirrors |
| 43 | + run: | |
| 44 | + # GitHub Actions caching proxy is at times unreliable |
| 45 | + # see https://github.com/actions/runner-images/issues/7048. |
| 46 | + mirrors=/etc/apt/mirrors.txt |
| 47 | + printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | \ |
| 48 | + sudo tee $mirrors |
| 49 | + curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append $mirrors |
| 50 | + sudo sed -i \ |
| 51 | + "s~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:$mirrors~" \ |
| 52 | + /etc/apt/sources.list |
| 53 | +
|
| 54 | + - name: Create build environment |
| 55 | + run: | |
| 56 | + sudo apt-get update |
| 57 | + ${{matrix.install}} |
| 58 | + sudo apt install locales-all |
| 59 | + cmake -E make_directory ${{runner.workspace}}/build |
| 60 | +
|
| 61 | + - name: Configure |
| 62 | + working-directory: ${{runner.workspace}}/build |
| 63 | + env: |
| 64 | + CXX: ${{matrix.cxx}} |
| 65 | + CXXFLAGS: ${{matrix.cxxflags}} |
| 66 | + run: | |
| 67 | + cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ |
| 68 | + -G Ninja \ |
| 69 | + -DCMAKE_CXX_STANDARD=${{matrix.std}} \ |
| 70 | + -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ |
| 71 | + -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \ |
| 72 | + -DFMT_DOC=OFF -DFMT_PEDANTIC=ON \ |
| 73 | + ${{matrix.fuzz}} -DBUILD_SHARED_LIBS=ON $GITHUB_WORKSPACE |
| 74 | +
|
| 75 | + - name: Build |
| 76 | + working-directory: ${{runner.workspace}}/build |
| 77 | + run: | |
| 78 | + threads=`nproc` |
| 79 | + cmake --build . --config ${{matrix.build_type}} --parallel $threads |
| 80 | +
|
| 81 | + - name: Test |
| 82 | + working-directory: ${{runner.workspace}}/build |
| 83 | + run: ctest -C ${{matrix.build_type}} |
| 84 | + env: |
| 85 | + CTEST_OUTPUT_ON_FAILURE: True |
0 commit comments