kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
182 stars 30 forks source link

ci: Save coverage files, add codecov workflow #631

Closed viccuad closed 4 months ago

viccuad commented 5 months ago

Description

Relates to https://github.com/kubewarden/kubewarden-controller/issues/623.

Change makefile targets to save coverage into specific coverage/{unit-tests,integration-tests}/* folders.

Add new codecov.yml GHA workflow that runs make test and uploads the coverage results to codecov via their codecov cli.

Tagged unit-tests and integration-tests results separately by setting the codecov flags on the workflow.

Needs a secret CODECOV_ORG_TOKEN present, which should be provided by the Codecov GH Application when installed.

Test

To see this working, we need the Codecov GH application installed in the org, and then we will see it working on the next PR opened against the repo.

Additional Information

Tradeoff

Potential improvement

viccuad commented 5 months ago

Will change the PR so that the upload of the test coverage results happen as part of the normal workflows included in the CI workflow, to not duplicate runs.

viccuad commented 4 months ago

PR changed, the upload seems to happen, see here: https://github.com/kubewarden/kubewarden-controller/actions/runs/7782853533/job/21220120905#step:5:93

Still, codecov server returns a 500. I would like to merge this and see how it behaves for follow-up PRs that don't come from forks.

codecov[bot] commented 4 months ago

Welcome to Codecov :tada:

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered :open_umbrella: