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

Commit

Permalink
Remove external sources from coverage (#484)
Browse files Browse the repository at this point in the history
* Filter external directory from coverage
* And split this tasks from the main workflow file
  • Loading branch information
Nicolas Cornu authored Apr 13, 2021
1 parent d0b1171 commit dd961ed
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 25 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/coreneuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,28 +161,3 @@ jobs:
# BRANCH: gh-pages # The branch the action should deploy to.
# FOLDER: ${{runner.workspace}}/nrn/build/docs # The folder the action should deploy.
# CLEAN: false # Automatically remove deleted files from the deploy branch
coverage:
runs-on: ubuntu-16.04
name: "Coverage Test"
steps:
- name: Install packages
run: |
sudo apt-get install doxygen bison flex libboost-all-dev libopenmpi-dev openmpi-bin python3-dev python3-pip lcov
shell: bash
- uses: actions/checkout@v2
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 .. -DCORENRN_ENABLE_MPI=ON -DCMAKE_C_FLAGS="-coverage -O0" -DCMAKE_CXX_FLAGS="-coverage -O0";
make
(cd ..; lcov --capture --initial --directory . --no-external --output-file build/coverage-base.info)
make test
(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
genhtml coverage-combined.info --output-directory coverage --demangle-cpp --ignore-errors source
bash <(curl -s https://codecov.io/bash)
46 changes: 46 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Coverage

on:
push:
branches:
- master
- live-debug*
- release/**
pull_request:
branches:
- master
- release/**

env:
BUILD_TYPE: Release
DEFAULT_PY_VERSION: 3.8

jobs:
coverage:
runs-on: ubuntu-16.04
name: "Coverage Test"
steps:
- name: Install packages
run: |
sudo apt-get install doxygen bison flex libboost-all-dev libopenmpi-dev openmpi-bin python3-dev python3-pip lcov
shell: bash
- uses: actions/checkout@v2
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 .. -DCORENRN_ENABLE_MPI=ON -DCMAKE_C_FLAGS="-coverage -O0" -DCMAKE_CXX_FLAGS="-coverage -O0";
make -j2
(cd ..; lcov --capture --initial --directory . --no-external --output-file build/coverage-base.info)
make test
(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: bash <(curl -s https://codecov.io/bash) -f build/coverage.info

0 comments on commit dd961ed

Please sign in to comment.