Skip to content

GHA: Use python-pillow/Pillow's Codecov token for own builds#4266

Merged
radarhere merged 6 commits intopython-pillow:masterfrom
hugovk:gha-codecov-bash
Dec 24, 2019
Merged

GHA: Use python-pillow/Pillow's Codecov token for own builds#4266
radarhere merged 6 commits intopython-pillow:masterfrom
hugovk:gha-codecov-bash

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Dec 13, 2019

Currently we're using the Codecov token of python-pillow/Pillow for all builds, including builds in forks. This means we get coverage reports at Codecov from those builds, and fork builds do not get coverage for their own builds.

The Codecov tool can automatically figure out the repo, and a token isn't needed, on Travis CI and AppVeyor, but not yet for GitHub Actions.

So, let's remove the token from the config file.

  • Then forks will get their own coverage for Travis and AppVeyor (but not GHA).

  • No fork coverage is sent upstream.

But if we're doing a python-pillow/Pillow build on GHA, then first copy a config file containing the token into the root, so we do get GHA coverage.

Once Codecov update to autodetect on GHA, we can remove this workaround.


If you do want GHA coverage from your fork builds, fetch your token from https://codecov.io/gh/my-username/Pillow/settings and add it as CODECOV_TOKEN at https://github.com/my-username/Pillow/settings/secrets.

We cannot rely on this secret alone for upstream, because secrets are not available to PRs, and we especially want coverage for PRs.

@hugovk
Copy link
Member Author

hugovk commented Dec 13, 2019

Example build from my fork with a token in secrets:

Example build from my fork with no token in secrets:

Neither of these commits show up on CodeCov for upstream:

@hugovk

This comment has been minimized.

@hugovk
Copy link
Member Author

hugovk commented Dec 14, 2019

All green now!

Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@radarhere
Copy link
Member

.github/workflows/codecov-upstream.yml is actually being detected by GHA as a separate job on individual repos.

Screen Shot 2019-12-24 at 12 40 35 pm

@hugovk
Copy link
Member Author

hugovk commented Dec 24, 2019

Thanks, I've moved it up a level:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants