Repository navigation
62 lines (52 loc) · 1.83 KB
/
Copy pathrun_codecoverage.yml
File metadata and controls
62 lines (52 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Code coverage
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BUILD_FOLDER: build
jobs:
build:
name: linux-64
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v3
id: cpu-cores
- name: Setup environment
uses: conda-incubator/setup-miniconda@v4
with:
miniforge-version: latest
activate-environment: ezc3d
environment-file: environment.yml
- name: Print conda info
run: |
conda info
conda list
- name: Install code coverage dependencies
run: |
conda install cmake git pkgconfig codecov lcov -cconda-forge
conda list
git submodule update --init --recursive
- name: Perform code coverage
run: |
MAIN_FOLDER=`pwd`
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $BUILD_FOLDER
cd $BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Coverage -DBUILD_TESTS=ON -DBUILD_EXAMPLE=OFF -DBUILD_DOC=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_PYTHON3=OFF ..
# The coverage target runs the tests and produces coverage.info (see modules/CodeCoverage.cmake)
make ezc3d_coverage -j${{ steps.cpu-cores.outputs.count }}
lcov --list coverage.info --ignore-errors inconsistent,mismatch
cd $BIORBD_FOLDER
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
files: ${{ env.BUILD_FOLDER }}/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false