2121 - name : Install dependencies
2222 run : |
2323 sudo apt update
24- sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip python3-pybind11 python3-pytest python3-pytest-rerunfailures
24+ sudo apt install -y build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache doxygen graphviz git curl autoconf libtool gperf nettle-dev libevent-dev debhelper python3-all python3-pip python3-pybind11 python3-pytest python3-pytest-rerunfailures lcov
2525 pip3 install pybind11-stubgen pytest --break-system-packages
2626
2727 - name : Install expat
@@ -106,12 +106,19 @@ jobs:
106106 - name : Install monero-python
107107 run : |
108108 mkdir -p build
109- pip3 install -vvv .
109+ export CFLAGS="--coverage -O0 -g"
110+ export CXXFLAGS="--coverage -O0 -g"
111+ export LDFLAGS="--coverage"
112+ COVERAGE=1 pip3 install -vvv .
110113
111114 - name : Setup test environment
112115 run : |
113116 docker compose -f tests/docker-compose.yml up -d node_1 node_2 xmr_wallet_1 xmr_wallet_2
114117
118+ - name : Reset coverage counters
119+ run : |
120+ lcov --directory . --zerocounters
121+
115122 - name : Run tests
116123 env :
117124 IN_CONTAINER : " true"
@@ -121,3 +128,15 @@ jobs:
121128 - name : Cleanup test environment
122129 if : always()
123130 run : docker compose -f tests/docker-compose.yml down -v
131+
132+ - name : Generate coverage report
133+ run : |
134+ lcov --capture --directory . --ignore-errors mismatch,mismatch,inconsistent,source,source,gcov,gcov --output-file coverage_full.info
135+ lcov --ignore-errors unused,unused --remove coverage_full.info '/usr/*' '*/external/*' '*/pybind11/*' '*monero-cpp/*' '*monero-project/*' --output-file coverage.info
136+
137+ - name : Upload coverage report
138+ uses : actions/upload-artifact@v4
139+ with :
140+ name : coverage-report
141+ path : coverage.info
142+
0 commit comments