Debian Codegraph @

.github/workflows/cmake-ctest.yml

raw
1 name: CMake
2
3 on:
4 push:
5 branches: [ "master" ]
6 pull_request:
7 branches: [ "master" ]
8
9 env:
10 BUILD_TYPE: Release
11 WITH_DLT_COVERAGE: ON
12 BUILD_GMOCK: OFF
13
14 jobs:
15 build:
16 runs-on: ubuntu-latest
17
18 steps:
19 - uses: actions/checkout@v4
20
21 - name: Prepare submodule
22 run: |
23 git submodule init
24 git submodule update
25
26 - name: Configure CMake
27 run: |
28 cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
29 -DWITH_DLT_COVERAGE=${{env.WITH_DLT_COVERAGE}} \
30 -DBUILD_GMOCK=${{env.BUILD_GMOCK}}
31
32 - name: Build
33 run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j$(nproc)
34
35 - name: Test
36 working-directory: ${{github.workspace}}/build
37 run: ctest -C ${{env.BUILD_TYPE}} --rerun-failed --output-on-failure
38
39 - name: Install dependencies
40 run: sudo apt-get install lcov
41
42 - name: Generate lcov report
43 working-directory: ${{github.workspace}}
44 run: bash util/dlt_coverage_report/lcov_report_generator.sh build -xe
45
46 - name: Archive coverage results
47 uses: actions/upload-artifact@v4
48 with:
49 name: dlt_coverage_report
50 path: ${{github.workspace}}/dlt_lcov_report
51
52 - name: Upload lcov report
53 if: github.ref == 'refs/heads/master'
54 run: |
55 git config user.name github-actions
56 git config user.email [email protected]
57 git checkout -b dlt_coverage_report
58 git submodule deinit -f googletest
59 rm -rf .git/modules/googletest
60 git rm -f googletest
61 git add --all
62 git commit -m "Upload lcov report for dlt-daemon"
63 git push -f origin dlt_coverage_report