diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3870b2b..a0bec99 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,6 +21,7 @@ jobs: os: ubuntu-24.04 cc: gcc-14 cxx: g++-14 + coverage: true - name: linux-clang-18 os: ubuntu-24.04 @@ -35,8 +36,21 @@ jobs: steps: - run: echo "CC=${{ matrix.cc }}" >>$GITHUB_ENV && echo "CXX=${{ matrix.cxx }}" >>$GITHUB_ENV if: ${{ matrix.cc != '' }} + - run: sudo apt-get update && sudo apt-get install --assume-yes --no-install-recommends lcov + if: ${{ matrix.coverage }} - uses: actions/checkout@v6 - run: bazel test ... ${{ matrix.bzlopts }} + if: ${{ !matrix.coverage }} + - run: bazel coverage ... ${{ matrix.bzlopts }} + if: ${{ matrix.coverage }} + - run: lcov --summary bazel-out/_coverage/_coverage_report.dat + if: ${{ matrix.coverage }} + - name: Upload + # codecov-cli is from https://github.com/getsentry/prevent-cli + run: | + pipx install codecov-cli==11.2.8 + codecovcli upload-process --fail-on-error --file bazel-out/_coverage/_coverage_report.dat + if: ${{ matrix.coverage }} - run: ./bzl/run_fuzz_tests ... ${{ matrix.bzlopts }} -- --timeout_secs=30 if: ${{ matrix.fuzz }} diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..2915028 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,17 @@ +# https://docs.codecov.com/docs/pull-request-comments#disable-comment +comment: false + +# TODO(robinlinden): Remove once we've made the coverage reporting less silly. +# +# gcc reports most lines as partially covered, even when they are seemingly +# branchless and should either be covered or not, and I've been unable to get +# clang coverage reporting working with Bazel 9 in robinlinden/hastur, so I'm +# not going to spend time on it here until I know why it's broken. +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true