CI: Fall back to codecov@v3 when @v4 has no token, add coveralls #5743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The merge of #5734 on master (merge commit on master: 5bd9b86) uses OpenID Connect (OIDC) to have a token-based coverage upload to Codecov.
But because OpenID Connect is only available for builds from users that use OIDC:
Docs on the Codecov action and using OIDC: https://github.com/marketplace/actions/codecov#using-oidc
The most reliable way to upload to codecov.io is codecov@v4 with the CODECOV_TOKEN secret.
These are the possible ways to set it up:
Without that hurdle jumped, we only have the option of fallbacks:
This PR implements all these fallbacks. These are useful for the xapi-project/xen-api and for working on and with forks.
If xapi-project/xen-api adopts the setup of the CODECOV_TOKEN, also forks of it would use it.
GitHub is trusted to protect the tokens like it it is trusted with all other GitHub action secrets.