@@ -3,15 +3,10 @@ name: CMake
3
3
on : [push, pull_request]
4
4
5
5
env :
6
- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7
6
BUILD_TYPE : Release
8
7
9
8
jobs :
10
9
build :
11
- # The CMake configure and build commands are platform agnostic and should work equally
12
- # well on Windows or Mac. You can convert this to a matrix build if you need
13
- # cross-platform coverage.
14
- # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
15
10
runs-on : ${{ matrix.os }}
16
11
strategy :
17
12
matrix :
@@ -20,30 +15,22 @@ jobs:
20
15
steps :
21
16
- uses : actions/checkout@v4
22
17
23
- - name : Create Build Environment
24
- # Some projects don't allow in-source building, so create a separate build directory
25
- # We'll use this as our working directory for all subsequent commands
26
- run : cmake -E make_directory ${{runner.workspace}}/build
27
-
28
18
- name : Configure CMake
29
- # Use a bash shell so we can use the same syntax for environment variable
30
- # access regardless of the host operating system
31
- shell : bash
32
- working-directory : ${{runner.workspace}}/build
33
- # Note the current convention is to use the -S and -B options here to specify source
34
- # and build directories, but this is only available with CMake 3.13 and higher.
35
- # The CMake binaries on the GitHub Actions machines are (as of this writing) 3.12
36
- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
19
+ run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
37
20
38
21
- name : Build
39
- working-directory : ${{runner.workspace}}/build
40
- shell : bash
41
- # Execute the build. You can specify a specific target with "--target <NAME>"
42
- run : cmake --build . --config $BUILD_TYPE
22
+ run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
43
23
44
24
- name : Test
45
- working-directory : ${{runner.workspace}}/build
46
- shell : bash
47
- # Execute tests defined by the CMake configuration.
48
- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
49
- run : ctest -C $BUILD_TYPE --output-on-failure
25
+ working-directory : ${{github.workspace}}/build
26
+ run : ctest -C ${{env.BUILD_TYPE}}
27
+
28
+ - name : Configure CMake with C++20
29
+ run : cmake -B ${{github.workspace}}/build_20 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_STANDARD=20
30
+
31
+ - name : Build with C++20
32
+ run : cmake --build ${{github.workspace}}/build_20 --config ${{env.BUILD_TYPE}}
33
+
34
+ - name : Test with C++20
35
+ working-directory : ${{github.workspace}}/build_20
36
+ run : ctest -C ${{env.BUILD_TYPE}}
0 commit comments