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

ci: Allow reporting of coverage on PRs from forks #1622

Merged
merged 9 commits into from
Oct 12, 2021

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Oct 11, 2021

Description

Resolves #1559

On all events (with the exception on schedule events) triggered by maintainers on the main project upload coverage to Codecov using the secrets.CODECOV_TOKEN (which seems to be faster?). If the event comes from a fork, then rely on the fact that the token isn't required, and upload the Coverage results on pull_request events.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Run CI on push events to master by default, but on any branch on a push event if the commit message contains '[ci all]'
   - Results in a skip of push event tests on PRs by default
* Run CI on pull_request events to master
* Allow reporting of test coverage to Codecov on pull_request events from forks
   - Use fact that secrets.CODECOV_TOKEN is not required for public repos
   - c.f. https://github.com/codecov/codecov-action/blob/260aa3b4b2f265b8578bc0e721e33ebf8ff53313/README.md
   - On all events, except schedule, from maintainers, upload coverage to codecov.io faster using the CODECOV_TOKEN secret
   - On pull_request events from contributor forks, upload coverage to codecov.io without using CODECOV_TOKEN secret

@matthewfeickert matthewfeickert added CI CI systems, GitHub Actions community Communication with users labels Oct 11, 2021
@matthewfeickert matthewfeickert self-assigned this Oct 11, 2021
@matthewfeickert matthewfeickert changed the title ci: Allow reporting of Coverage from PRs from forks ci: Allow reporting of coverage from PRs from forks Oct 11, 2021
@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #1622 (5cdaedd) into master (7ecaa63) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1622   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files          63       63           
  Lines        4048     4048           
  Branches      576      576           
=======================================
  Hits         3955     3955           
  Misses         54       54           
  Partials       39       39           
Flag Coverage Δ
contrib 25.44% <ø> (ø)
unittests 97.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ecaa63...5cdaedd. Read the comment docs.

@matthewfeickert
Copy link
Member Author

Current result:

view

@matthewfeickert matthewfeickert changed the title ci: Allow reporting of coverage from PRs from forks ci: Allow reporting of coverage on PRs from forks Oct 11, 2021
@matthewfeickert
Copy link
Member Author

@kratsg I have the 'ci all' bit working now.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@matthewfeickert
Copy link
Member Author

In the interest of moving other PRs forward I'm going to merge this in as we now have the [ci all] working in tests. If there are any further requests for edits I'm happy to implement them ASAP in a follow up PR.

@matthewfeickert matthewfeickert merged commit bc4b24a into master Oct 12, 2021
@matthewfeickert matthewfeickert deleted the ci/allow-codecov-reporting-on-prs branch October 12, 2021 20:28
matthewfeickert added a commit that referenced this pull request Oct 12, 2021
* Report coverage to Codecov without using a secret Codecov token
   - c.f. codecov/codecov-action#29 (comment)
   - Effectively reverts Codecov logic part of PR #1622
* Ensure codecov/codecov-action v2 used
   - Amends PR #1623
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI systems, GitHub Actions community Communication with users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get Codecov to run on PRs from outside the project
2 participants