From dd961ed6bba34a6b4e18a9aa3675df465bd5a709 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Tue, 13 Apr 2021 21:56:33 +0200 Subject: [PATCH] Remove external sources from coverage (#484) * Filter external directory from coverage * And split this tasks from the main workflow file --- .github/workflows/coreneuron-ci.yml | 25 ---------------- .github/workflows/coverage.yml | 46 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coreneuron-ci.yml b/.github/workflows/coreneuron-ci.yml index 748578f21..61e0812d0 100644 --- a/.github/workflows/coreneuron-ci.yml +++ b/.github/workflows/coreneuron-ci.yml @@ -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) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..ed037bbdc --- /dev/null +++ b/.github/workflows/coverage.yml @@ -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 +