|
1 | | -# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. |
2 | | -# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml |
3 | 1 | name: CMake on a single platform |
4 | 2 |
|
5 | 3 | on: |
|
9 | 7 | branches: [ "main" ] |
10 | 8 |
|
11 | 9 | env: |
12 | | - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) |
13 | 10 | BUILD_TYPE: Release |
14 | 11 |
|
15 | 12 | jobs: |
16 | 13 | build: |
17 | | - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
18 | | - # You can convert this to a matrix build if you need cross-platform coverage. |
19 | | - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
20 | 14 | runs-on: ubuntu-latest |
21 | 15 |
|
22 | 16 | steps: |
23 | 17 | - uses: actions/checkout@v3 |
24 | 18 |
|
25 | | - - name: Install xmllint |
26 | | - run: sudo apt-get install -y xsltproc |
| 19 | + - name: Install dependencies |
| 20 | + run: | |
| 21 | + sudo apt-get install -y xsltproc doxygen lcov |
27 | 22 |
|
28 | 23 | - name: Configure CMake |
29 | | - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
30 | | - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
31 | 24 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} |
32 | 25 |
|
33 | 26 | - name: Build |
34 | | - # Build your program with the given configuration |
35 | 27 | run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} |
36 | 28 |
|
37 | 29 | - name: Test |
38 | 30 | working-directory: ${{github.workspace}}/build |
39 | | - # Execute tests defined by the CMake configuration. |
40 | | - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
41 | | - run: ctest -C ${{env.BUILD_TYPE}} |
42 | | - |
| 31 | + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure |
| 32 | + |
| 33 | + - name: Generate Doxygen Documentation |
| 34 | + run: doxygen doc/Doxyfile |
| 35 | + |
| 36 | + - name: Run tests and generate coverage |
| 37 | + run: | |
| 38 | + lcov --capture --directory ${{github.workspace}}/build --output-file coverage.info |
| 39 | + genhtml coverage.info --output-directory coverage |
| 40 | +
|
| 41 | + - name: Deploy Doxygen Documentation and Coverage to GitHub Pages |
| 42 | + uses: peaceiris/actions-gh-pages@v3 |
| 43 | + with: |
| 44 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + publish_dir: | |
| 46 | + ./doc/html |
| 47 | + ./coverage |
0 commit comments