-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (39 loc) · 1.27 KB
/
cmake-ubuntu.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
name: Ubuntu
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov
- name: Configure CMake
run: cmake --preset gh-coverage
- name: Build
run: cmake --build ${{github.workspace}}/build/debug/gh-coverage
- name: Test
working-directory: ${{github.workspace}}/build/debug/gh-coverage
run: ctest
- name: Generate Coverage
working-directory: ${{github.workspace}}/build/debug/gh-coverage
run: |
lcov -c -d ./CMakeFiles/sac-format.dir/ -o sac-format.lcov
lcov -r sac-format.lcov "/usr*" -o sac-format.lcov
- name: Upload Coverage Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{github.workspace}}/build/debug/gh-coverage/sac-format.lcov
name: sac-format-coverage
verbose: true
- name: Upload Coverage Codacy
working-directory: ${{github.workspace}}/build/debug/gh-coverage
run: |
export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }}
bash <(curl -Ls https://coverage.codacy.com/get.sh)