1- # This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2- # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
31name : build-linux
42
53on :
97 branches : [ "master" ]
108
119env :
12- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1310 BUILD_TYPE : Release
1411
1512jobs :
16- build :
17- # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18- # You can convert this to a matrix build if you need cross-platform coverage.
19- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
13+ build-gcc :
2014 runs-on : ubuntu-latest
2115
2216 steps :
@@ -26,17 +20,47 @@ jobs:
2620 run : sudo apt-get install libgtest-dev
2721
2822 - name : Configure CMake
29- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
30- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
31- run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
23+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -GNinja
24+
25+ - name : Build with GCC
26+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
27+
28+ - name : Test
29+ working-directory : ${{github.workspace}}/build
30+ run : ctest -C ${{env.BUILD_TYPE}}
31+ build-clang :
32+ runs-on : ubuntu-latest
33+
34+ steps :
35+ - uses : actions/checkout@v3
36+
37+ - name : Install gtest manually
38+ run : sudo apt-get install libgtest-dev
39+
40+ - name : Configure CMake
41+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -GNinja
3242
3343 - name : Build
34- # Build your program with the given configuration
3544 run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
3645
3746 - name : Test
3847 working-directory : ${{github.workspace}}/build
39- # Execute tests defined by the CMake configuration.
40- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
4148 run : ctest -C ${{env.BUILD_TYPE}}
49+ build-clang-sanitizer :
50+ runs-on : ubuntu-latest
51+
52+ steps :
53+ - uses : actions/checkout@v3
54+
55+ - name : Install gtest
56+ run : sudo apt-get install libgtest-dev
57+
58+ - name : Configure CMake
59+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBRCPP_SANITIZER=address,undefined -GNinja
60+
61+ - name : Build
62+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
4263
64+ - name : Test
65+ working-directory : ${{github.workspace}}/build
66+ run : ctest -C ${{env.BUILD_TYPE}}
0 commit comments