|
1 | | -name: Build |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: [push] |
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 | linux: |
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: ubuntu-latest |
16 | 11 |
|
17 | 12 | steps: |
18 | 13 | - uses: actions/checkout@v2 |
19 | 14 |
|
| 15 | + - name: Install gcc-9 |
| 16 | + run: | |
| 17 | + sudo apt-get install -y g++-9 |
| 18 | + echo "::set-env name=CC::gcc-9" |
| 19 | + echo "::set-env name=CXX::g++-9" |
| 20 | +
|
20 | 21 | - 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 | 22 | run: cmake -E make_directory ${{runner.workspace}}/build |
24 | 23 |
|
25 | 24 | - name: Configure CMake |
26 | | - # Use a bash shell so we can use the same syntax for environment variable |
27 | | - # access regardless of the host operating system |
28 | 25 | shell: bash |
29 | 26 | working-directory: ${{runner.workspace}}/build |
30 | | - # Note the current convention is to use the -S and -B options here to specify source |
31 | | - # and build directories, but this is only available with CMake 3.13 and higher. |
32 | | - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
33 | 27 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
34 | 28 |
|
35 | 29 | - name: Build |
36 | 30 | working-directory: ${{runner.workspace}}/build |
37 | 31 | shell: bash |
38 | | - # Execute the build. You can specify a specific target with "--target <NAME>" |
39 | 32 | run: cmake --build . --config $BUILD_TYPE |
40 | 33 |
|
41 | 34 | - name: Test |
42 | 35 | working-directory: ${{runner.workspace}}/build |
43 | 36 | shell: bash |
44 | | - # Execute tests defined by the CMake configuration. |
45 | | - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
46 | 37 | run: ctest -C $BUILD_TYPE |
| 38 | + |
47 | 39 | macOS: |
48 | | - # The CMake configure and build commands are platform agnostic and should work equally |
49 | | - # well on Windows or Mac. You can convert this to a matrix build if you need |
50 | | - # cross-platform coverage. |
51 | | - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix |
52 | 40 | runs-on: macos-latest |
53 | 41 |
|
54 | 42 | steps: |
55 | 43 | - uses: actions/checkout@v2 |
56 | 44 |
|
57 | 45 | - name: Create Build Environment |
58 | | - # Some projects don't allow in-source building, so create a separate build directory |
59 | | - # We'll use this as our working directory for all subsequent commands |
60 | 46 | run: cmake -E make_directory ${{runner.workspace}}/build |
61 | 47 |
|
62 | 48 | - name: Configure CMake |
63 | | - # Use a bash shell so we can use the same syntax for environment variable |
64 | | - # access regardless of the host operating system |
65 | 49 | shell: bash |
66 | 50 | working-directory: ${{runner.workspace}}/build |
67 | | - # Note the current convention is to use the -S and -B options here to specify source |
68 | | - # and build directories, but this is only available with CMake 3.13 and higher. |
69 | | - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
70 | 51 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
71 | 52 |
|
72 | 53 | - name: Build |
73 | 54 | working-directory: ${{runner.workspace}}/build |
74 | 55 | shell: bash |
75 | | - # Execute the build. You can specify a specific target with "--target <NAME>" |
76 | 56 | run: cmake --build . --config $BUILD_TYPE |
77 | 57 |
|
78 | 58 | - name: Test |
79 | 59 | working-directory: ${{runner.workspace}}/build |
80 | 60 | shell: bash |
81 | | - # Execute tests defined by the CMake configuration. |
82 | | - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
83 | 61 | run: ctest -C $BUILD_TYPE |
| 62 | + |
84 | 63 | windows: |
85 | | - # The CMake configure and build commands are platform agnostic and should work equally |
86 | | - # well on Windows or Mac. You can convert this to a matrix build if you need |
87 | | - # cross-platform coverage. |
88 | | - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix |
89 | 64 | runs-on: windows-latest |
90 | 65 |
|
91 | 66 | steps: |
92 | 67 | - uses: actions/checkout@v2 |
93 | 68 |
|
94 | 69 | - name: Create Build Environment |
95 | | - # Some projects don't allow in-source building, so create a separate build directory |
96 | | - # We'll use this as our working directory for all subsequent commands |
97 | 70 | run: cmake -E make_directory ${{runner.workspace}}/build |
98 | 71 |
|
99 | 72 | - name: Configure CMake |
100 | | - # Use a bash shell so we can use the same syntax for environment variable |
101 | | - # access regardless of the host operating system |
102 | 73 | shell: bash |
103 | 74 | working-directory: ${{runner.workspace}}/build |
104 | | - # Note the current convention is to use the -S and -B options here to specify source |
105 | | - # and build directories, but this is only available with CMake 3.13 and higher. |
106 | | - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
107 | 75 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE |
108 | 76 |
|
109 | 77 | - name: Build |
110 | 78 | working-directory: ${{runner.workspace}}/build |
111 | 79 | shell: bash |
112 | | - # Execute the build. You can specify a specific target with "--target <NAME>" |
113 | 80 | run: cmake --build . --config $BUILD_TYPE |
114 | 81 |
|
115 | 82 | - name: Test |
116 | 83 | working-directory: ${{runner.workspace}}/build |
117 | 84 | shell: bash |
118 | | - # Execute tests defined by the CMake configuration. |
119 | | - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
120 | 85 | run: ctest -C $BUILD_TYPE |
121 | | - |
122 | | - |
123 | | - |
0 commit comments