Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable codecov in GH check #77

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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$)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did and it didn't seem to immediately work. I'm sure there's a way to get it to work, but I didn't want to spend more time on it. Feel free to work on it if you care.

# 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='//.*'