Skip to content
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
26 changes: 26 additions & 0 deletions .github/actions/benchmark_epilogue/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Benchmark Epilogue"
description: "Processes coverage information with lcov and uploads it to coveralls/codecov"
inputs:
build-output-dir:
required: true
description: 'Build output directory'
runs:
using: "composite"
steps:
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'googlecpp'
# Where the output from the benchmark tool is stored
output-file-path: ${{ inputs.build-output-dir }}/benchmark/benchmark_result.json
# Where the previous data file is stored
external-data-json-path: ./cache/benchmark_result.json
# Workflow will fail when an alert happens
fail-on-alert: true
47 changes: 47 additions & 0 deletions .github/actions/coverage_epilogue/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Coverage Epilogue"
description: "Processes coverage information with lcov and uploads it to coveralls/codecov"
inputs:
build-output-dir:
required: true
description: 'Build output directory'
GITHUB_TOKEN:
required: true

runs:
using: "composite"
steps:
- name: "Install lcov"
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y lcov

- name: Generate Coverage Report
shell: bash
run: |
lcov --capture --directory ${{ inputs.build-output-dir }} --output-file coverage.info --ignore-errors mismatch
lcov --remove coverage.info '/usr/*' '*/_deps/*' '*/include/bitlib/bit-algorithms/libpopcnt.h' '*/test/inc/*' '*/test/src/*' --output-file coverage.info
lcov --list coverage.info
# Generate an HTML report
genhtml coverage.info --output-directory out/coverage

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
out/coverage
coverage.info

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ inputs.GITHUB_TOKEN }}
path-to-lcov: coverage.info

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.info
flags: unittests
name: codecov-coverage-report
22 changes: 21 additions & 1 deletion .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,21 @@ jobs:
preset: tests
target: bitlib-tests
build_type: Debug
- distro: ubuntu-latest
os: linux
compiler: gcc
c_compiler: gcc
cpp_compiler: g++
stdlib: libstdcxx
preset: coverage
target: bitlib-tests
build_type: Debug

steps:
- uses: actions/checkout@v4

- name: "Install Clang 19"
if: matrix.distro == 'ubuntu-latest' && matrix.c_compiler == 'clang-19'
if: matrix.os == 'linux' && matrix.c_compiler == 'clang-19'
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg lsb-release
Expand Down Expand Up @@ -104,3 +113,14 @@ jobs:
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --test-dir ${{ steps.strings.outputs.build-output-dir }} --build-config ${{ matrix.build_type }} --output-on-failure --parallel

- uses: ./.github/actions/coverage_epilogue
if: matrix.preset == 'coverage'
with:
build-output-dir: ${{ steps.strings.outputs.build-output-dir }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/benchmark_epilogue
if: matrix.preset == 'benchmark'
with:
build-output-dir: ${{ steps.strings.outputs.build-output-dir }}
102 changes: 0 additions & 102 deletions .github/workflows/coverage.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if (BITLIB_HWY)
endif()

if (BITLIB_BENCHMARK)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
enable_testing()
add_subdirectory(benchmark)
endif()

Expand Down
Loading