Skip to content

Commit 815e5a6

Browse files
committed
Merge remote-tracking branch 'garcia6l20/add_github_actions' into add_github_actions
2 parents 572ee73 + 1e3ce8b commit 815e5a6

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/cmake.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CMake
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
env:
66
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
@@ -18,6 +18,13 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
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'
2128

2229
steps:
2330
- uses: actions/checkout@v2
@@ -26,7 +33,7 @@ jobs:
2633
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
2734

2835
- name: Install dependencies
29-
run: sudo apt-get install g++-10
36+
run: sudo apt-get install ${{ matrix.install }}
3037

3138
- name: Create Build Environment
3239
# Some projects don't allow in-source building, so create a separate build directory
@@ -38,12 +45,17 @@ jobs:
3845
# access regardless of the host operating system
3946
shell: bash
4047
working-directory: ${{runner.workspace}}/build
41-
env:
48+
env:
4249
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.
4552
# 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
4759
4860
- name: Build
4961
working-directory: ${{runner.workspace}}/build
@@ -56,4 +68,4 @@ jobs:
5668
shell: bash
5769
# Execute tests defined by the CMake configuration.
5870
# 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

Comments
 (0)