Skip to content

Commit

Permalink
enable codecov in GH check
Browse files Browse the repository at this point in the history
Change-Id: I2ee14831a7562c5735f20ccedd13fb2e887cbcdc
  • Loading branch information
garymm committed Sep 10, 2023
1 parent 660c528 commit 350b5ac
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,37 @@ jobs:
--features=${{ matrix.feature }} \
//...
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: mount bazel cache
uses: actions/cache@v3
with:
path: "~/.cache/bazel"
key: bazel-coverage

- name: install libtinfo5
# clang tools load libtinfo5 for color diagnostics but `ubuntu-latest`
# runners already have `libtinfo.so.6` installed. We just create a
# symlink since it's faster than installing libtinfo5.
# https://github.com/circleci/circleci-images/issues/430#issuecomment-522602495
run: |
sudo ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 /lib/x86_64-linux-gnu/libtinfo.so.5
- run: |
bazel \
--bazelrc=.github/workflows/ci.bazelrc \
coverage \
//...
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./bazel-out/_coverage/_coverage_report.dat
fail_ci_if_error: true

build:
runs-on: ubuntu-latest
strategy:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ build --remote_download_minimal

test --test_output=all
test --test_verbose_timeout_warnings

coverage --combined_report=lcov
coverage --strategy=CoverageReport=local
# At least some of this is needed for the coverage tool to work.
coverage --experimental_split_coverage_postprocessing
coverage --experimental_fetch_all_coverage_outputs
coverage --remote_download_outputs=all
coverage --experimental_remote_download_regex=.*/((testlogs/.*/_coverage/.*)|coverage.dat$|_coverage/_coverage_report.dat$)
# Not sure why it doesn't work with clang. Should be possible.
coverage --extra_toolchains=//toolchain:gcc
# Needed because our tests are in a different package than the code they test.
coverage --instrumentation_filter='//.*'

0 comments on commit 350b5ac

Please sign in to comment.