|
8 | 8 |
|
9 | 9 | jobs:
|
10 | 10 | 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/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
15 | 11 | runs-on: ubuntu-latest
|
16 | 12 |
|
17 | 13 | steps:
|
| 14 | + # Checkout the repository |
18 | 15 | - uses: actions/checkout@v2
|
19 | 16 |
|
| 17 | + # Checkout submodules if necessary |
20 | 18 | - name: Checkout Submodules
|
21 |
| - run: python3 $(pwd)/git_to_https.py .gitmodules && git submodule update --init && git submodule foreach --recursive python3 $(pwd)/git_to_https.py && git submodule update --init |
| 19 | + run: | |
| 20 | + python3 $(pwd)/git_to_https.py .gitmodules |
| 21 | + git submodule update --init |
| 22 | + git submodule foreach --recursive python3 $(pwd)/git_to_https.py |
| 23 | + git submodule update --init |
22 | 24 |
|
| 25 | + # Create build directory (out-of-source build) |
23 | 26 | - 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 |
| - - name: SetupLibs |
29 |
| - working-directory: ${{runner.workspace}}/build |
30 |
| - shell: bash |
31 |
| - # Execute the build. You can specify a specific target with "--target <NAME>" |
32 |
| - run: sudo apt-get install googletest && cd /usr/src/googletest && sudo cmake ./ && sudo make && sudo make install |
| 27 | + run: cmake -E make_directory ${{ runner.workspace }}/build |
33 | 28 |
|
| 29 | + # Configure the CMake project |
34 | 30 | - name: Configure CMake
|
35 |
| - # Use a bash shell so we can use the same syntax for environment variable |
36 |
| - # access regardless of the host operating system |
| 31 | + working-directory: ${{ runner.workspace }}/build |
37 | 32 | shell: bash
|
38 |
| - working-directory: ${{runner.workspace}}/build |
39 |
| - # Note the current convention is to use the -S and -B options here to specify source |
40 |
| - # and build directories, but this is only available with CMake 3.13 and higher. |
41 |
| - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
42 | 33 | run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
43 | 34 |
|
| 35 | + # Build the project using CMake |
44 | 36 | - name: Build
|
45 |
| - working-directory: ${{runner.workspace}}/build |
| 37 | + working-directory: ${{ runner.workspace }}/build |
46 | 38 | shell: bash
|
47 |
| - # Execute the build. You can specify a specific target with "--target <NAME>" |
48 | 39 | run: cmake --build . --config $BUILD_TYPE
|
49 | 40 |
|
| 41 | + # Run tests defined by the CMake configuration |
50 | 42 | - name: Test
|
51 |
| - working-directory: ${{runner.workspace}}/build |
| 43 | + working-directory: ${{ runner.workspace }}/build |
52 | 44 | shell: bash
|
53 |
| - # Execute tests defined by the CMake configuration. |
54 |
| - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
55 |
| - run: ctest -C $BUILD_TYPE |
| 45 | + run: ctest -V -C $BUILD_TYPE |
0 commit comments