add tests #315
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: build | |
| on: push | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| build_type: [Debug, RelWithDebInfo] | |
| config: | |
| - {os: ubuntu-24.04, compiler: GNU, CC: gcc-14, CXX: g++-14, warnall: ON, clanglib: OFF} | |
| #todo clanglib ON as soon as packages below are installable again | |
| - {os: ubuntu-24.04, compiler: LLVM, CC: clang-18, CXX: clang++-18, warnall: ON, clanglib: OFF} | |
| - {os: windows-latest, compiler: MSVC, CC: cl, CXX: cl, warnall: OFF, clanglib: OFF} | |
| - {os: macos-latest, compiler: LLVM, CC: clang, CXX: clang++, warnall: ON, clanglib: ON} | |
| env: | |
| CC: ${{matrix.config.CC}} | |
| CXX: ${{matrix.config.CXX}} | |
| # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | |
| # You can convert this to a matrix build if you need cross-platform coverage. | |
| # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
| runs-on: ${{matrix.config.os}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| #todo also see comment above | |
| # currently not found :( | |
| # - name: Install libc++ | |
| # if: ${{startsWith(matrix.config.os, 'ubuntu')}} | |
| # run: > | |
| # sudo apt-get install -y libc++abi-18-dev libc++-18-dev | |
| - name: Configure CMake | |
| # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
| # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
| run: > | |
| cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
| -DUL_ALL_WARNINGS=${{matrix.config.warnall}} | |
| -DUL_USE_CLANG_STDLIB=${{matrix.config.clanglib}} | |
| - name: Build | |
| # Build your program with the given configuration | |
| run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} | |
| - name: Test | |
| working-directory: ${{github.workspace}}/build | |
| # Execute tests defined by the CMake configuration. | |
| # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
| run: ctest -C ${{matrix.build_type}} --output-on-failure | |
| # not working properly (analyses 3rd party dirs, also seems to use old compiler version?) | |
| # - name: Run Include What You Use | |
| # if: ${{!startsWith(matrix.config.os, 'macos')}} | |
| # uses: EmilGedda/[email protected] | |
| # with: | |
| # compilation-database-path: 'build' | |
| # output-format: 'iwyu' # Or 'clang' | |
| # no-error: 'false' |