Skip to content

Commit

Permalink
Use gcovr for coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT committed Jan 25, 2024
1 parent d626835 commit 9cbfe48
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/step_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,20 @@ jobs:
with:
fetch-depth: 0
- uses: lukka/get-cmake@latest
- name: Get test coverage for ${{ matrix.coverage }}
# TODO: use threeal/gcovr-action when it supports other output formats
# https://github.com/threeal/gcovr-action/issues/151
- run: python3 -m pip install gcovr
- name: Run CMake workflow
uses: lukka/run-cmake@v10.3
with:
workflowPreset: "ci-coverage-${{ matrix.coverage }}"
- name: Get lcov data
uses: danielealbano/lcov-action@v3
with:
# Note lcov-action prepends and appends wild-cards *. Account for those
# https://github.com/danielealbano/lcov-action/issues/11
remove_patterns: /test/,/cmake-build*/
- name: Get coverage data
run: gcovr --xml coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: ${{ matrix.coverage }} coverage
files: coverage.info
files: coverage.xml
flags: ${{ matrix.coverage }}
verbose: true

Expand All @@ -46,6 +45,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.x
# TODO: use threeal/gcovr-action when it supports other output formats
# https://github.com/threeal/gcovr-action/issues/151
- run: python3 -m pip install gcovr
- name: Setup spglib
run: |
python -m pip install --upgrade pip
Expand All @@ -55,16 +57,12 @@ jobs:
--config-settings=build-dir=build
- name: Test pytest with coverage
run: pytest --cov=spglib
- name: Get lcov data
uses: danielealbano/lcov-action@v3
with:
# Note lcov-action prepends and appends wild-cards *. Account for those
# https://github.com/danielealbano/lcov-action/issues/11
remove_patterns: /test/,/cmake-build*/,/tmp/
- name: Get coverage data
run: gcovr --xml coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: python_api coverage
files: coverage.info,.coverage
files: coverage.xml,.coverage
flags: python_api
verbose: true

0 comments on commit 9cbfe48

Please sign in to comment.