@@ -40,25 +40,26 @@ jobs:
40
40
- uses : hendrikmuhs/ccache-action@main
41
41
with :
42
42
variant : sccache
43
- key : ${{ github.job }}-${{ github.runner.os }}-coverage
43
+ key : ${{ github.job }}-${{ github.runner.os }}
44
44
restore-keys : |
45
- ccache-libmamba-${{ github.runner.os }}-coverage
45
+ ccache-libmamba-${{ github.runner.os }}
46
46
- name : Build mamba with coverage
47
47
run : |
48
48
cmake -B build/ -G Ninja \
49
49
--preset mamba-unix-shared-debug \
50
50
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
51
51
-D CMAKE_C_COMPILER_LAUNCHER=sccache \
52
52
-D MAMBA_WARNING_AS_ERROR=ON \
53
- -D BUILD_LIBMAMBAPY=OFF \
53
+ -D BUILD_LIBMAMBAPY=ON \
54
+ -D BUILD_MICROMAMBA=ON \
54
55
-D ENABLE_MAMBA_ROOT_PREFIX_FALLBACK=OFF \
55
56
-D CMAKE_BUILD_TYPE=Debug \
56
- -D CMAKE_CXX_FLAGS_DEBUG="-g -O0 --coverage" \
57
- -D CMAKE_C_FLAGS_DEBUG="-g -O0 --coverage"
57
+ -D CMAKE_CXX_FLAGS_DEBUG="-g -O0 -fno-omit-frame-pointer - -coverage" \
58
+ -D CMAKE_C_FLAGS_DEBUG="-g -O0 -fno-omit-frame-pointer - -coverage"
58
59
cmake --build build/ --parallel
59
60
- name : Show build cache statistics
60
61
run : sccache --show-stats
61
- - name : Run tests with coverage
62
+ - name : Run C++ tests with coverage
62
63
run : |
63
64
unset CONDARC # Interferes with tests
64
65
./build/libmamba/ext/solv-cpp/tests/test_solv_cpp
@@ -67,13 +68,27 @@ jobs:
67
68
run : |
68
69
sudo apt-get update
69
70
sudo apt-get install -y lcov
70
- - name : Generate coverage report
71
+ - name : Generate C++ coverage report
71
72
run : |
72
- lcov --directory . --capture --output-file coverage.info
73
- lcov --remove coverage.info '*/tests/*' --output-file coverage.info
73
+ lcov --directory . --capture --output-file cpp_coverage.info
74
+ lcov --remove cpp_coverage.info '/usr/*' '*/tests/*' '*/build/*' --output-file cpp_coverage.info --ignore-errors unused
75
+ lcov --summary cpp_coverage.info --ignore-errors mismatch
76
+ - name : Install libmambapy
77
+ run : |
78
+ cmake --install build/ --prefix "${CONDA_PREFIX}"
79
+ python -m pip install --no-deps --no-build-isolation ./libmambapy
80
+ - name : Run Python tests with coverage
81
+ run : |
82
+ # Run libmambapy tests with coverage
83
+ python -m pytest libmambapy/tests/ --cov=libmambapy --cov-report=xml --cov-report=term-missing
84
+ # Run micromamba tests with coverage
85
+ export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
86
+ python -m pytest micromamba/tests/ --cov=micromamba --cov-report=xml --cov-report=term-missing
74
87
- name : Upload coverage to Codecov
75
88
uses : codecov/codecov-action@v4
76
89
with :
77
- file : ./coverage.info
90
+ files : |
91
+ ./cpp_coverage.info
92
+ ./coverage.xml
78
93
fail_ci_if_error : true
79
94
token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments