1
1
name : CMake
2
2
3
- on : [push]
3
+ on : [push, pull_request ]
4
4
5
5
env :
6
6
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
18
18
fail-fast : false
19
19
matrix :
20
20
compiler : [g++-10, clang]
21
+ include :
22
+ - compiler : clang
23
+ cxx_flags : -stdlib=libc++
24
+ # TODO figure out why this is not set automatically
25
+ exe_linker_flags : -lc++
26
+ - compiler : g++-10
27
+ install : ' g++-10'
21
28
22
29
steps :
23
30
- uses : actions/checkout@v2
26
33
run : sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
27
34
28
35
- name : Install dependencies
29
- run : sudo apt-get install g++-10
36
+ run : sudo apt-get install ${{ matrix.install }}
30
37
31
38
- name : Create Build Environment
32
39
# Some projects don't allow in-source building, so create a separate build directory
@@ -38,12 +45,17 @@ jobs:
38
45
# access regardless of the host operating system
39
46
shell : bash
40
47
working-directory : ${{runner.workspace}}/build
41
- env :
48
+ env :
42
49
CXX : ${{ matrix.compiler }}
43
- # Note the current convention is to use the -S and -B options here to specify source
44
- # and build directories, but this is only available with CMake 3.13 and higher.
50
+ # Note the current convention is to use the -S and -B options here to specify source
51
+ # and build directories, but this is only available with CMake 3.13 and higher.
45
52
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
46
- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
53
+ run : |
54
+ cmake ${{runner.workspace}} \
55
+ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
56
+ -DCMAKE_CXX_FLAGS=${{ matrix.cxx_flags }} \
57
+ -DCMAKE_EXE_LINKER_FLAGS=${{ matrix.exe_linker_flags }} \
58
+ -DCMAKE_VERBOSE_MAKEFILE=ON
47
59
48
60
- name : Build
49
61
working-directory : ${{runner.workspace}}/build
56
68
shell : bash
57
69
# Execute tests defined by the CMake configuration.
58
70
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
59
- run : ctest -C $BUILD_TYPE
71
+ run : ctest --output-on-failure - C $BUILD_TYPE
0 commit comments