Skip to content

Commit f5f725e

Browse files
committed
Build test and example on ci too
1 parent ea9009a commit f5f725e

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

.github/workflows/cmake-multi-platform.yml

+26-24
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,33 @@ jobs:
4545
c_compiler: cl
4646

4747
steps:
48-
- uses: actions/checkout@v3
48+
- uses: actions/checkout@v3
4949

50-
- name: Set reusable strings
51-
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
52-
id: strings
53-
shell: bash
54-
run: |
55-
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
50+
- name: Set reusable strings
51+
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
52+
id: strings
53+
shell: bash
54+
run: |
55+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
5656
57-
- name: Configure CMake
58-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
59-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
60-
run: >
61-
cmake -B ${{ steps.strings.outputs.build-output-dir }}
62-
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
63-
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
64-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
65-
-S ${{ github.workspace }}
57+
- name: Configure CMake
58+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
59+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
60+
run: >
61+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
62+
-D CMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
63+
-D CMAKE_C_COMPILER=${{ matrix.c_compiler }}
64+
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }}
65+
-D WITH_TESTS=YES
66+
-D WITH_EXAMPLE=YES
67+
-S ${{ github.workspace }}
6668
67-
- name: Build
68-
# 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).
69-
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
69+
- name: Build
70+
# 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).
71+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
7072

71-
- name: Test
72-
working-directory: ${{ steps.strings.outputs.build-output-dir }}
73-
# 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).
74-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
75-
run: ctest --build-config ${{ matrix.build_type }}
73+
- name: Test
74+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
75+
# 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).
76+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
77+
run: ctest --build-config ${{ matrix.build_type }}

0 commit comments

Comments
 (0)