-
Notifications
You must be signed in to change notification settings - Fork 51
48 lines (43 loc) · 1.49 KB
/
coverage_tests.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
name: Coverage Tests
on: [push, pull_request]
jobs:
coverage_tests:
if: github.repository == 'lutraconsulting/MDAL'
runs-on: ubuntu-latest
steps:
- name: Checkout MDAL
uses: actions/checkout@v2
- name: install deps
run: |
sudo add-apt-repository ppa:ubuntugis/ppa -y
sudo apt-get install -y --allow-unauthenticated libgdal-dev
sudo apt-get install -y libhdf5-dev libnetcdf-dev
sudo apt-get install -y libxml2-dev
sudo apt-get install -y lcov
- name: build MDAL with coverage
run: |
mkdir -p ../build_coverage_lnx
cd ../build_coverage_lnx
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_TESTS=ON \
-DENABLE_COVERAGE=ON \
../MDAL
make -j`nproc`
- name: Run tests
env:
CTEST_TARGET_SYSTEM: Linux-gcc
run: |
cd ../build_coverage_lnx
ctest -VV
- name: Prepare coverage report
run: |
cd ../build_coverage_lnx
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '*/tests/*' '/usr/*' '*googletest/*' '*/3rdparty/*' */external_drivers/* --output-file coverage.info
lcov --list coverage.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ../build_coverage_lnx/coverage.info