Skip to content

Commit ed88315

Browse files
Update CI workflow for C++ coverage generation and testing (#571)
* Update CI workflow for C++ coverage generation and testing * Avoid mkdir error in CI workflow by using -p * Update CI workflow to include coverage flags Review-1 * Added lcov to environment.yml under myst_nb * Apply coverage flag in build and adjust C++ testing * added installation lcov * Update .github/workflows/ci.yml * Apply suggestions from code review --------- Co-authored-by: ਗਗਨਦੀਪ ਸਿੰਘ (Gagandeep Singh) <[email protected]>
1 parent 4688182 commit ed88315

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/ci.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,28 @@ jobs:
3333
run: |
3434
pip install -r requirements.txt
3535
pip install -r docs/requirements.txt
36+
37+
- name: Install lcov
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y lcov
3641
3742
- name: Build package
3843
run: |
39-
python scripts/build/install.py
40-
44+
CXXFLAGS=--coverage CFLAGS=--coverage python scripts/build/install.py
45+
# coverage tests
4146
- name: Run tests
4247
run: |
4348
python -m pytest --doctest-modules --cov=./ --cov-report=xml -s
4449
50+
- name: Capture Coverage Data with lcov
51+
run: |
52+
lcov --capture --directory . --output-file coverage.info --no-external
53+
54+
- name: Generate HTML Coverage Report with genhtml
55+
run: |
56+
genhtml coverage.info --output-directory coverage_report
57+
4558
- name: Upload Coverage
4659
uses: codecov/codecov-action@v3
4760
with:

environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ dependencies:
1111
- sphinx==5.0
1212
- sphinx-readable-theme==1.3.0
1313
- myst_nb==0.17.2
14+
- lcov

0 commit comments

Comments
 (0)