Fix CodeCov #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake lcov | |
sudo apt-get install -y libgtest-dev googletest | |
- name: Configure CMake | |
run: | | |
cmake -B build -DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage" | |
- name: Build | |
run: cmake --build build --clean-first | |
- name: Run Tests | |
working-directory: ./build | |
run: ./ConcurrentHashMapTest | |
- name: Generate Coverage Report | |
run: | | |
lcov --capture --directory ./build --output-file coverage.info \ | |
--rc geninfo_unexecuted_blocks=1 \ | |
--ignore-errors mismatch | |
lcov --remove coverage.info '/usr/*' '*/test/*' --output-file coverage.info | |
lcov --list coverage.info | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.info |