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

Generate coverage build and upload #414

Merged
merged 2 commits into from
Jan 24, 2024
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
43 changes: 32 additions & 11 deletions .github/workflows/build-test-cplusplus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,39 @@ name: Build and Test C++
on:
push:
branches:
- main
- main
release:
types: [published]
pull_request:
branches:
- '**'
- "**"

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
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
cmake -B ../build -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=1
cmake --build ../build -- -j 6
../build/RunTests
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"
valgrind:
name: valgrind ubuntu
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -82,13 +103,13 @@ jobs:
name: Windows Latest
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: cmake, RunTests with Windows
run: |
mkdir build-win
cd build-win
cmake ..
cmake --build . --config Release -j 6
ctest -C Release -j 6
- name: cmake, RunTests with Windows
run: |
mkdir build-win
cd build-win
cmake ..
cmake --build . --config Release -j 6
ctest -C Release -j 6
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ target_link_libraries(RunTests
blake3
)

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

find_package(Threads REQUIRED)

add_library(uint128 STATIC uint128_t/uint128_t.cpp)
Expand Down