-
Notifications
You must be signed in to change notification settings - Fork 19
55 lines (44 loc) · 1.3 KB
/
github-actions.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
name: Build and Test
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache directories
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-cache
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install lcov
- name: Create build directory
run: mkdir build
- name: Configure CMake
run: |
cd build
cmake .. -DCODE_COVERAGE=ON -DEXAMPLES=OFF
- name: Build and test
run: |
cd build
make
make test
- name: Collect code coverage
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload code coverage to Codecov
run: |
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- name: Upload code coverage to GitHub
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage.info