File: cmake-ctest.yml

package info (click to toggle)
dlt-daemon 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,296 kB
  • sloc: ansic: 58,041; cpp: 16,199; sh: 1,769; xml: 1,440; python: 376; makefile: 32
file content (63 lines) | stat: -rw-r--r-- 1,800 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CMake

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

env:
  BUILD_TYPE: Release
  WITH_DLT_COVERAGE: ON
  BUILD_GMOCK: OFF

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Prepare submodule
      run: |
          git submodule init
          git submodule update

    - name: Configure CMake
      run: |
          cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
                                               -DWITH_DLT_COVERAGE=${{env.WITH_DLT_COVERAGE}} \
                                               -DBUILD_GMOCK=${{env.BUILD_GMOCK}}

    - name: Build
      run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -- -j$(nproc)

    - name: Test
      working-directory: ${{github.workspace}}/build
      run: ctest -C ${{env.BUILD_TYPE}} --rerun-failed --output-on-failure

    - name: Install dependencies
      run: sudo apt-get install lcov

    - name: Generate lcov report
      working-directory: ${{github.workspace}}
      run: bash util/dlt_coverage_report/lcov_report_generator.sh build -xe

    - name: Archive coverage results
      uses: actions/upload-artifact@v4
      with:
        name: dlt_coverage_report
        path: ${{github.workspace}}/dlt_lcov_report

    - name: Upload lcov report
      if: github.ref == 'refs/heads/master'
      run: |
        git config user.name github-actions
        git config user.email github-actions@github.com
        git checkout -b dlt_coverage_report
        git submodule deinit -f googletest
        rm -rf .git/modules/googletest
        git rm -f googletest
        git add --all
        git commit -m "Upload lcov report for dlt-daemon"
        git push -f origin dlt_coverage_report