1+ name : CMake
2+
3+ on : [push]
4+
5+ env :
6+ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7+ BUILD_TYPE : RelWithDebInfo
8+
9+ jobs :
10+ build :
11+
12+ runs-on : ${{ matrix.os }}
13+ strategy :
14+ matrix :
15+ os : [ubuntu-latest]
16+
17+ steps :
18+ - uses : actions/checkout@v2
19+
20+ - name : Create Build Environment
21+ # Some projects don't allow in-source building, so create a separate build directory
22+ # We'll use this as our working directory for all subsequent commands
23+ run : cmake -E make_directory ${{runner.workspace}}/build
24+
25+ - name : Install conan
26+ shell : bash
27+ run : |
28+ python3 -m pip install --upgrade pip setuptools
29+ python3 -m pip install conan
30+ source ~/.profile
31+
32+ - name : Configure CMake
33+ # Use a bash shell so we can use the same syntax for environment variable
34+ # access regardless of the host operating system
35+ shell : bash
36+ working-directory : ${{runner.workspace}}/build
37+ # Note the current convention is to use the -S and -B options here to specify source
38+ # and build directories, but this is only available with CMake 3.13 and higher.
39+ # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
40+ #
41+ # We need to source the profile file to make sure conan is in PATH
42+ run : |
43+ source ~/.profile
44+ cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
45+
46+ - name : Build
47+ working-directory : ${{runner.workspace}}/build
48+ shell : bash
49+ # Execute the build. You can specify a specific target with "--target <NAME>"
50+ run : cmake --build . --config $BUILD_TYPE
51+
52+ - name : Test
53+ working-directory : ${{runner.workspace}}/build
54+ shell : bash
55+ # Execute tests defined by the CMake configuration.
56+ # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
57+ run : ctest -C $BUILD_TYPE
0 commit comments