This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
64 lines (60 loc) · 2.22 KB
/
coverage.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
64
name: Coverage
concurrency:
group: ${{ github.workflow }}#${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
jobs:
coverage:
runs-on: ubuntu-20.04
name: "Coverage Test"
steps:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install bison doxygen flex lcov libboost-all-dev \
libopenmpi-dev libfl-dev ninja-build openmpi-bin python3-dev \
python3-pip
shell: bash
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Build and Test for Coverage
id: build-test
shell: bash
working-directory: ${{runner.workspace}}/CoreNeuron
run: |
mkdir build && cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-coverage" \
-DCMAKE_CXX_FLAGS="-coverage" \
-DCORENRN_ENABLE_MPI=ON \
-DCORENRN_ENABLE_DEBUG_CODE=ON
cmake --build .
(cd ..; lcov --capture --initial --directory . --no-external --output-file build/coverage-base.info)
ctest --output-on-failure
(cd ..; lcov --capture --directory . --no-external --output-file build/coverage-run.info)
lcov --add-tracefile coverage-base.info --add-tracefile coverage-run.info --output-file coverage-combined.info
lcov --remove coverage-combined.info --output-file coverage.info "*/external/*"
lcov --list coverage.info
- name: Upload to codecov.io
run: |
# Download codecov script and perform integrity checks
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --import # One-time step
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -f build/coverage.info