Fix CodeCov #6
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 | |
| sudo apt-get install -y libgtest-dev googletest lcov | |
| - name: Configure CMake with Coverage | |
| run: | | |
| cmake -B build -DCMAKE_BUILD_TYPE=Debug \ | |
| -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage" | |
| - name: Build | |
| run: cmake --build build | |
| - name: Run Tests | |
| working-directory: ./build | |
| run: ./ConcurrentHashMapTest | |
| - name: Generate Coverage Report | |
| run: | | |
| lcov --capture --directory ./build --output-file coverage.info | |
| 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 | |
| flags: cpp | |
| name: Codecov-CPP |