Skip to content

Commit 37c3c50

Browse files
committed
update workflow
1 parent f274bab commit 37c3c50

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

.github/workflows/build-linux.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
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
31
name: build-linux
42

53
on:
@@ -9,14 +7,10 @@ on:
97
branches: [ "master" ]
108

119
env:
12-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1310
BUILD_TYPE: Release
1411

1512
jobs:
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

Comments
 (0)