Skip to content

Add coverage workflow #2

Add coverage workflow

Add coverage workflow #2

Workflow file for this run

name: Coverage
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install LCov and dependencies
run: |
sudo apt-get update -q
sudo apt-get install -q -y lcov libhdf5-dev libboost-all-dev
git clone https://github.com/catchorg/Catch2.git
cd Catch2
git checkout "v3.5.3"
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install
- name: Configure
run: cmake --preset=ci-coverage
- name: Build
run: cmake --build build/coverage -j 2
- name: Test
working-directory: build/coverage
run: ctest --output-on-failure --no-tests=error -j 2
- name: Process coverage info
run: cmake --build build/coverage -t coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: build/coverage/coverage.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}