fix: pin cast_if_required FetchContent to specific commit hash for re… #13
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install lcov | |
| run: sudo apt-get update && sudo apt-get install -y lcov | |
| - name: Configure CMake (Debug + coverage) | |
| run: | | |
| cmake -B build -S tests \ | |
| -DCMAKE_BUILD_TYPE=Debug \ | |
| -DSERIALSTORM_COVERAGE=ON | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Run tests | |
| run: ctest --test-dir build --output-on-failure | |
| - name: Collect coverage data | |
| run: | | |
| lcov --rc geninfo_unexecuted_blocks=1 \ | |
| --capture \ | |
| --directory build \ | |
| --output-file coverage.info | |
| # Strip system headers and third-party Catch2 sources | |
| lcov --remove coverage.info \ | |
| '/usr/*' \ | |
| '*/build/_deps/*' \ | |
| --output-file coverage.info | |
| lcov --list coverage.info | |
| - name: Generate HTML report | |
| run: genhtml coverage.info --output-directory coverage-report | |
| - name: Upload HTML coverage report as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: coverage-report/ | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage.info | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |