Skip to content

Commit 31a1b20

Browse files
Stephan Kantelbergarnemertz
authored andcommitted
added windows builds, extend to multiple compiler
1 parent caba448 commit 31a1b20

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/build_cmake.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: [ubuntu-latest]
21+
compiler: [ {cpp: g++-10, c: gcc-10}, {cpp: g++-11, c: gcc-11}, {cpp: clang++-10, c: clang-10}, {cpp: clang++-11, c: clang-11}, {cpp: clang++-12, c: clang-12} ]
2122

2223
steps:
2324
- uses: actions/checkout@v2
@@ -37,6 +38,11 @@ jobs:
3738
# We'll use this as our working directory for all subsequent commands
3839
run: cmake -E make_directory ${{runner.workspace}}/build
3940

41+
- run: |
42+
sudo apt update
43+
sudo apt install gcc-11 g++-11 clang-12 llvm-12
44+
shell: bash
45+
4046
- name: Install conan
4147
shell: bash
4248
run: |
@@ -49,6 +55,9 @@ jobs:
4955
# access regardless of the host operating system
5056
shell: bash
5157
working-directory: ${{runner.workspace}}/build
58+
env:
59+
CC: ${{ matrix.compiler.c }}
60+
CXX: ${{ matrix.compiler.cpp }}
5261
# Note the current convention is to use the -S and -B options here to specify source
5362
# and build directories, but this is only available with CMake 3.13 and higher.
5463
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
@@ -70,3 +79,41 @@ jobs:
7079
# Execute tests defined by the CMake configuration.
7180
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
7281
run: ctest -C $BUILD_TYPE
82+
windows:
83+
runs-on: ${{ matrix.os }}
84+
strategy:
85+
matrix:
86+
os: [windows-latest, windows-2019]
87+
steps:
88+
- uses: actions/checkout@v2
89+
- name: Install conan
90+
shell: bash
91+
run: |
92+
python3 -m pip install --upgrade pip setuptools
93+
python3 -m pip install conan jinja2
94+
- name: Create Build Environment
95+
# Some projects don't allow in-source building, so create a separate build directory
96+
# We'll use this as our working directory for all subsequent commands
97+
run: cmake -E make_directory ${{github.workspace}}/build
98+
- name: Configure CMake
99+
# Use a bash shell so we can use the same syntax for environment variable
100+
shell: bash
101+
# access regardless of the host operating system
102+
working-directory: ${{github.workspace}}/build
103+
# Note the current convention is to use the -S and -B options here to specify source
104+
# and build directories, but this is only available with CMake 3.13 and higher.
105+
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
106+
#
107+
# We need to source the profile file to make sure conan is in PATH
108+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
109+
- name: Build
110+
shell: bash
111+
working-directory: ${{github.workspace}}/build
112+
# Execute the build. You can specify a specific target with "--target <NAME>"
113+
run: cmake --build . --config $BUILD_TYPE
114+
- name: Test
115+
shell: bash
116+
working-directory: ${{github.workspace}}/build
117+
# Execute tests defined by the CMake configuration.
118+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
119+
run: ctest -C $BUILD_TYPE

0 commit comments

Comments
 (0)