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

Make codecov report use secret #162

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Conversation

kdarkhan
Copy link
Collaborator

@kdarkhan kdarkhan commented Jan 30, 2024

This addresses #148. Codecov coverage report upload are not stable. The suggested solution is to use
per project secret. This project have that enabled but it is not usable for pull request workflows triggered from forks. Due to Github's security restrictions, only PRs based on local branches have access to secrets.

This PR amends the existing workflow by not pushing the reports to Codecov. The reports are instead uploaded to Github artifacts (the artifacts are stored for 90 days by default).

Then a new workflow is introduced which executes after every successful execution of the existing workflow. It downloads the artifact and uploads the report to Codecov using the security token.

Copy link
Collaborator

@mgeisler mgeisler left a comment

Choose a reason for hiding this comment

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

Wow, thanks for implementing this — it looks good and I'm excited to see it in action.

Comment on lines +4 to +7
workflow_run:
workflows: ["tests"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a comment explaining that this makes the workflow here trigger after every completed run of the tests workflow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

This addresses google#148. Codecov coverage report uploads are not
stable. The suggested solution is to use
per project secret. This project have that enabled but it is
not usable for pull request workflows triggered from forks. Due to
Github's security restrictions, only PRs based on local branches
have access to secrets.

This PR amends the existing workflow by not pushing the reports
to Codecov. The reports are instead uploaded to Github artifacts
(the artifacts are stored for 90 days by default).

Then a new workflow is introduced which executes after every
successful execution of the existing workflow. It downloads
the artifact and uploads the report to Codecov using the security
token.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants