Add C++-Modules Based Linux CI workflow #1
Workflow file for this run
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: linux-modules | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| cxx: [ g++-14, g++-15, clang++-16, clang++-17] | |
| build_type: [ Debug, Release ] | |
| std: [17, 20] | |
| include: | |
| - cxx: g++-14 | |
| install: sudo apt-get install g++-14 | |
| - cxx: g++-15 | |
| install: sudo apt-get install g++-15 | |
| - cxx: clang++-16 | |
| install: sudo apt-get install clang-16 libc++-16-dev libc++abi-16-dev | |
| - cxx: clang++-16 | |
| cxxflags: -stdlib=libc++ | |
| install: sudo apt-get install clang-16 libc++-16-dev libc++abi-16-dev | |
| - cxx: clang++-17 | |
| install: sudo apt-get install clang-17 libc++-17-dev libc++abi-17-dev | |
| - cxx: clang++-17 | |
| cxxflags: -stdlib=libc++ | |
| install: sudo apt-get install clang-17 libc++-17-dev libc++abi-17-dev | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: Set timezone | |
| run: sudo timedatectl set-timezone 'Europe/Kyiv' | |
| - name: Add repositories for newer GCC | |
| run: | | |
| sudo apt-add-repository ppa:ubuntu-toolchain-r/test | |
| - name: Add Ubuntu mirrors | |
| run: | | |
| # GitHub Actions caching proxy is at times unreliable | |
| # see https://github.com/actions/runner-images/issues/7048. | |
| mirrors=/etc/apt/mirrors.txt | |
| printf 'http://azure.archive.ubuntu.com/ubuntu\tpriority:1\n' | \ | |
| sudo tee $mirrors | |
| curl http://mirrors.ubuntu.com/mirrors.txt | sudo tee --append $mirrors | |
| sudo sed -i \ | |
| "s~http://azure.archive.ubuntu.com/ubuntu/~mirror+file:$mirrors~" \ | |
| /etc/apt/sources.list | |
| - name: Create build environment | |
| run: | | |
| sudo apt-get update | |
| ${{matrix.install}} | |
| sudo apt install locales-all | |
| cmake -E make_directory ${{runner.workspace}}/build | |
| - name: Configure | |
| working-directory: ${{runner.workspace}}/build | |
| env: | |
| CXX: ${{matrix.cxx}} | |
| CXXFLAGS: ${{matrix.cxxflags}} | |
| run: | | |
| cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \ | |
| -G Ninja \ | |
| -DCMAKE_CXX_STANDARD=${{matrix.std}} \ | |
| -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ | |
| -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \ | |
| -DFMT_DOC=OFF -DFMT_PEDANTIC=ON \ | |
| ${{matrix.fuzz}} -DBUILD_SHARED_LIBS=ON $GITHUB_WORKSPACE | |
| - name: Build | |
| working-directory: ${{runner.workspace}}/build | |
| run: | | |
| threads=`nproc` | |
| cmake --build . --config ${{matrix.build_type}} --parallel $threads | |
| - name: Test | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -C ${{matrix.build_type}} | |
| env: | |
| CTEST_OUTPUT_ON_FAILURE: True |