-
Notifications
You must be signed in to change notification settings - Fork 297
63 lines (51 loc) · 1.71 KB
/
cmake-ctest.yml
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@v3
- 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}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- 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@v3
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 [email protected]
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