@@ -2,19 +2,22 @@ name: continuous-integration
22
33on :
44 push :
5- release :
6- types : [published]
5+ branches :
6+ - master
7+ pull_request :
78
89jobs :
910 build :
1011 runs-on : ${{ matrix.os }}
12+ env :
13+ BUILD_TYPE : Debug
1114 strategy :
1215 fail-fast : false
1316 matrix :
14- os : [macos-latest , ubuntu-20.04]
17+ os : [macos-10.15 , ubuntu-20.04]
1518 cxx : [g++-10, clang++]
1619 include :
17- - os : windows-latest
20+ - os : windows-2019
1821 cxx : msvc
1922
2023 steps :
@@ -30,48 +33,23 @@ jobs:
3033 # Note the current convention is to use the -S and -B options here to specify source
3134 # and build directories, but this is only available with CMake 3.13 and higher.
3235 # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
33- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$GITHUB_WORKSPACE/artifacts
36+ run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX:PATH=$GITHUB_WORKSPACE/artifacts
3437
3538 - name : Build
3639 working-directory : ${{github.workspace}}/build
3740 shell : bash
3841 # Execute the build. You can specify a specific target with "--target <NAME>"
39- run : cmake --build . --config Debug
42+ run : cmake --build . --config $BUILD_TYPE
4043
4144 - name : Test
4245 working-directory : ${{github.workspace}}/build
4346 shell : bash
4447 # Execute tests defined by the CMake configuration.
4548 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
46- run : ctest -C Debug
49+ run : ctest -C $BUILD_TYPE
4750
48- - name : Install
51+ - name : Test Install
4952 working-directory : ${{github.workspace}}/build
5053 shell : bash
51- # Use CMake to "install" build artifacts (only interested in CMake registered targets) to our custom artifacts directory
52- run : cmake --install . --config Debug
53-
54- # Only run last two steps if this is a release
55- - name : Release
56- if : github.event_name == 'release'
57- env :
58- CXX : ${{ matrix.cxx }}
59- # Use a bash shell so we can use the same syntax for environment variable
60- # access regardless of the host operating system
61- shell : bash
62- working-directory : ${{github.workspace}}/build
63- # Note the current convention is to use the -S and -B options here to specify source
64- # and build directories, but this is only available with CMake 3.13 and higher.
65- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
66- run : |
67- cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$GITHUB_WORKSPACE/artifacts
68- cmake --build . --config Release
69- cmake --install . --config Release
70-
71- # Only Upload releases
72- - name : Upload
73- if : github.event_name == 'release'
74- uses : actions/upload-artifact@v2
75- with :
76- name : build_${{ github.sha }}_${{ matrix.os }}_${{ matrix.cxx }}
77- path : ${{github.workspace}}/artifacts
54+ # Test install with CMake to the "artifacts" directory
55+ run : cmake --install . --config $BUILD_TYPE
0 commit comments