Debian Codegraph @

.github/workflows/cmake.yml

raw symbols SCIP
1 name: CMake
2
3 on: [ push, pull_request ]
4
5 env:
6 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7 BUILD_TYPE: Debug
8 CMAKE_BUILD_PARALLEL_LEVEL: 4
9 CTEST_PARALLEL_LEVEL: 5
10
11 jobs:
12 build-linux:
13 # The CMake configure and build commands are platform agnostic and should work equally
14 # well on Windows or Mac. You can convert this to a matrix build if you need
15 # cross-platform coverage.
16 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
17 runs-on: ubuntu-latest
18 strategy:
19 matrix:
20 cxxflags: [ "", "-fsanitize=address", "-fsanitize=undefined", "-Wall -Wextra -Werror" ]
21 env:
22 CXXFLAGS: ${{ matrix.cxxflags }}
23 steps:
24 - uses: actions/checkout@v4
25
26 - name: Install dependencies
27 run: sudo apt-get update && sudo apt-get install catch2 pandoc doxygen
28
29 - name: Configure CMake
30 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
31 # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
32 run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
33
34 - name: Build
35 # Build your program with the given configuration
36 run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
37
38 - name: Test
39 working-directory: ${{github.workspace}}/build
40 # Execute tests defined by the CMake configuration.
41 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
42 run: ctest -C ${{env.BUILD_TYPE}}
43
44 build-windows:
45 runs-on: windows-latest
46
47 steps:
48 - uses: actions/checkout@v4
49
50 - name: Bring runner env vars to workflows
51 shell: bash
52 run: |
53 echo "local_app_data=$LOCALAPPDATA" >> $GITHUB_ENV
54 echo "vcpkg_root=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
55
56 - uses: actions/cache@v4
57 with:
58 # use backslashes in path here for Windows.
59 path: ${{ env.local_app_data }}\vcpkg\archives
60 key: windows-vcpkg-cache-${{ hashFiles('vcpkg.json') }}
61 restore-keys: windows-vcpkg-cache-
62
63 - name: Install documentation generators
64 run: choco install pandoc doxygen.install
65
66 - name: Configure CMake
67 run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
68 env:
69 CMAKE_TOOLCHAIN_FILE: ${{ env.vcpkg_root }}/scripts/buildsystems/vcpkg.cmake
70
71 - name: Build
72 run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
73
74 - name: Test
75 working-directory: ${{github.workspace}}/build
76 run: ctest -C ${{env.BUILD_TYPE}}