Skip to content

Commit

Permalink
ci: add a job to test the cmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
gministeri authored and jgriffiths committed Feb 8, 2024
1 parent eb63b2d commit 004af20
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,32 @@ run_scan_build_clang:
- ./tools/cleanup.sh && ./tools/autogen.sh
- CC=clang CFLAGS="-O0" scan-build-11 ./configure --enable-export-all --enable-swig-python --enable-swig-java --disable-clear-tests --disable-asm
- scan-build-11 --keep-cc --exclude src/secp256k1/ make -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))

cmake-test:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
script:
- mv _cmake cmake
- mv _CMakeLists.txt CMakeLists.txt
- mv src/_CMakeLists.txt src/CMakeLists.txt
- mv src/ctest/_CMakeLists.txt src/ctest/CMakeLists.txt
- cmake -B build-cmake -S .
-DBUILD_SHARED_LIBS:BOOL=FALSE
-DCMAKE_BUILD_TYPE:STRING=Debug
-DWALLYCORE_ENABLE_TESTS:BOOL=TRUE
-DWALLYCORE_ENABLE_COVERAGE:BOOL=TRUE
- cmake --build build-cmake
#- ctest --test-dir build-cmake --output-junit report.xml --output-on-failure -E "test_(clear|elements_tx)"
- cd build-cmake
- ctest --output-on-failure -E "test_(clear|elements_tx)"
- cd -
- pip install gcovr
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
reports:
# junit: build-cmake/report.xml # junit report generation not available in cmake 3.18
coverage_report:
coverage_format: cobertura
path: coverage.xml

0 comments on commit 004af20

Please sign in to comment.