|
1 | | -# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. |
2 | | -# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml |
3 | 1 | name: Build and test on multiple platforms |
4 | 2 |
|
5 | 3 | on: |
|
14 | 12 | runs-on: ${{ matrix.os }} |
15 | 13 |
|
16 | 14 | strategy: |
17 | | - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. |
18 | 15 | fail-fast: false |
19 | 16 |
|
20 | | - # Set up a matrix to run the following 3 configurations: |
21 | | - # 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator> |
22 | | - # 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator> |
23 | | - # 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator> |
24 | | - # |
25 | | - # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. |
26 | 17 | matrix: |
27 | 18 | os: [ubuntu-latest, windows-latest] |
28 | 19 | build_type: [Debug] |
@@ -61,15 +52,12 @@ jobs: |
61 | 52 | git status |
62 | 53 |
|
63 | 54 | - name: Set reusable strings |
64 | | - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. |
65 | 55 | id: strings |
66 | 56 | shell: bash |
67 | 57 | run: | |
68 | 58 | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" |
69 | 59 |
|
70 | 60 | - name: Configure CMake |
71 | | - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
72 | | - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
73 | 61 | run: > |
74 | 62 | cmake -B ${{ steps.strings.outputs.build-output-dir }} |
75 | 63 | -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
|
79 | 67 | -S ${{ github.workspace }} |
80 | 68 |
|
81 | 69 | - name: Build |
82 | | - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
83 | 70 | run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |
84 | 71 |
|
85 | 72 | - name: Test |
86 | 73 | working-directory: ${{ steps.strings.outputs.build-output-dir }} |
87 | | - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
88 | | - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
89 | | - run: ctest --build-config ${{ matrix.build_type }} |
| 74 | + run: ctest --rerun-failed --output-on-failure --build-config ${{ matrix.build_type }} |
0 commit comments