Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run for coverage and upload to Coveralls #373

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,31 @@ concurrency:
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Collect coverage data
run: |
sudo apt-get update
sudo apt-get install lcov -y
sudo apt-get install snap -y
sudo snap install cmake --classic
hash -r
cmake -B ../build -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=1 -DBUILD_BLS_PYTHON_BINDINGS=0 -DBUILD_BLS_BENCHMARKS=0
cmake --build ../build -- -j 6
../build/src/runtest
lcov --directory ../build --capture --output-file lcov.info
lcov --remove lcov.info '*_deps/*' '/usr/*' --output-file lcov.info
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
if: always()
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
path-to-lcov: './lcov.info'

build_wheels:
name: Build and Test on ${{ matrix.os }} CPython ${{ matrix.python }}
runs-on: ${{ matrix.os }}
Expand Down
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ target_link_libraries(bls
sodium
)

if(WITH_COVERAGE)
target_compile_options(bls PRIVATE --coverage)
target_link_options(bls PRIVATE --coverage)
endif()

install(DIRECTORY ${relic_SOURCE_DIR}/include/ DESTINATION include/chiabls)
install(DIRECTORY ${relic_BINARY_DIR}/include/ DESTINATION include/chiabls)
install(FILES ${HEADERS} DESTINATION include/chiabls)
Expand All @@ -52,6 +57,10 @@ if(BUILD_BLS_TESTS)
Catch2::Catch2
Threads::Threads
)
if(WITH_COVERAGE)
target_compile_options(runtest PRIVATE --coverage)
target_link_options(runtest PRIVATE --coverage)
endif()
endif()

if(BUILD_BLS_BENCHMARKS)
Expand Down