Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 72eadd4

Browse files
author
Omar Awile
authored
Add codecov coverage tests (#478)
* Add codecov coverage tests * fetch 2 last commits for coverage report * add badge to README
1 parent 1440c4b commit 72eadd4

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

.github/workflows/coreneuron-ci.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CoreNEURON CI
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- master
77
- live-debug*
88
- release/**
@@ -59,8 +59,8 @@ jobs:
5959
run: |
6060
sudo apt-get install g++-${GCC_VERSION}
6161
shell: bash
62-
env:
63-
GCC_VERSION: ${{ matrix.config.gcc_version }}
62+
env:
63+
GCC_VERSION: ${{ matrix.config.gcc_version }}
6464

6565
- name: Set up Python3
6666
uses: actions/setup-python@v2
@@ -88,7 +88,7 @@ jobs:
8888
if: ${{ matrix.config.use_nmodl == 'ON' || matrix.config.use_ispc == 'ON' }}
8989
run: |
9090
python3 -m pip install --upgrade pip jinja2 pyyaml pytest "sympy<1.6";
91-
91+
9292
- uses: actions/checkout@v2
9393

9494
- name: Install Python3 documentation dependencies
@@ -97,7 +97,7 @@ jobs:
9797
run: |
9898
python3 -m pip install --upgrade pip
9999
python3 -m pip install --upgrade -r docs/docs_requirements.txt
100-
100+
101101
- name: Build and Test
102102
id: build-test
103103
shell: bash
@@ -124,7 +124,7 @@ jobs:
124124
fi
125125
make
126126
ctest --output-on-failure
127-
make install
127+
make install
128128
env:
129129
cmake_option: ${{ matrix.config.cmake_option }}
130130
USE_ISPC: ${{ matrix.config.use_ispc }}
@@ -139,8 +139,7 @@ jobs:
139139
- name: live debug session on failure
140140
if: failure() && startsWith(github.ref, 'refs/heads/live-debug')
141141
uses: mxschmitt/action-tmate@v3
142-
143-
- name: Documentation
142+
- name: Documentation
144143
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.config.documentation == 'ON' }}
145144
id: documentation
146145
working-directory: ${{runner.workspace}}/CoreNeuron
@@ -161,3 +160,28 @@ jobs:
161160
# BRANCH: gh-pages # The branch the action should deploy to.
162161
# FOLDER: ${{runner.workspace}}/nrn/build/docs # The folder the action should deploy.
163162
# CLEAN: false # Automatically remove deleted files from the deploy branch
163+
coverage:
164+
runs-on: ubuntu-16.04
165+
name: "Coverage Test"
166+
steps:
167+
- name: Install packages
168+
run: |
169+
sudo apt-get install doxygen bison flex libboost-all-dev libopenmpi-dev openmpi-bin python3-dev python3-pip lcov
170+
shell: bash
171+
- uses: actions/checkout@v2
172+
with:
173+
fetch-depth: 2
174+
- name: Build and Test for Coverage
175+
id: build-test
176+
shell: bash
177+
working-directory: ${{runner.workspace}}/CoreNeuron
178+
run: |
179+
mkdir build && cd build
180+
cmake .. -DCORENRN_ENABLE_MPI=ON -DCMAKE_C_FLAGS="-coverage -O0" -DCMAKE_CXX_FLAGS="-coverage -O0";
181+
make
182+
(cd ..; lcov --capture --initial --directory . --no-external --output-file build/coverage-base.info)
183+
make test
184+
(cd ..; lcov --capture --directory . --no-external --output-file build/coverage-run.info)
185+
lcov --add-tracefile coverage-base.info --add-tracefile coverage-run.info --output-file coverage-combined.info
186+
genhtml coverage-combined.info --output-directory coverage --demangle-cpp --ignore-errors source
187+
bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/BlueBrain/CoreNeuron.svg?branch=master)](https://travis-ci.org/BlueBrain/CoreNeuron) ![CoreNEURON CI](https://github.com/BlueBrain/CoreNeuron/workflows/CoreNEURON%20CI/badge.svg)
1+
[![Build Status](https://travis-ci.org/BlueBrain/CoreNeuron.svg?branch=master)](https://travis-ci.org/BlueBrain/CoreNeuron) ![CoreNEURON CI](https://github.com/BlueBrain/CoreNeuron/workflows/CoreNEURON%20CI/badge.svg) [![codecov](https://codecov.io/gh/BlueBrain/CoreNeuron/branch/master/graph/badge.svg?token=mguTdBx93p)](https://codecov.io/gh/BlueBrain/CoreNeuron)
22

33
# CoreNEURON
44
> Optimised simulator engine for [NEURON](https://github.com/neuronsimulator/nrn)

0 commit comments

Comments
 (0)