Skip to content

Kcgallagher bugfix default workflows 268 #1641

Kcgallagher bugfix default workflows 268

Kcgallagher bugfix default workflows 268 #1641

Workflow file for this run

name: CPP Coverage Report
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
build-and-test:
runs-on: ubuntu-20.04
env:
CC: gcc-10
CXX: g++-10
steps:
- name: checkout repo & submodules
uses: actions/checkout@v2
with:
submodules: true
- name: install tools
run: sudo apt install lcov
- name: make build directory
run: mkdir build_dir
- name: run unit tests with coverage
run: |
cmake ../cEpiabm/. -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
cmake --build . --parallel $(nproc) --target unit_tests
ctest -j2 --output-on-failure
working-directory: build_dir
- name: upload coverage results
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/test/*' '*/examples/*' '*/src/configuration/json.hpp' --output-file coverage.info
lcov --list coverage.info
bash <(curl https://codecov.io/bash) -f coverage.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
working-directory: build_dir