ros-controls / ros2_control_ci

This repository holds reusable workflows for CI of the ros2_control framework.
https://control.ros.org
Apache License 2.0
2 stars 1 forks source link

Add token instructions to codecov-action #16

Closed fmauch closed 6 months ago

fmauch commented 6 months ago

Since 4v this is required. For this to work, adding a CODECOV_TOKEN action secret needs to be added to the GH repository.

This should fix our problems on uploading the code coverage as discussed in https://github.com/ros-controls/control_toolbox/pull/188. Closes #15

In the target repo a secret has to be added in the project settings: image

The token can be extracted on codecov.io.

christophfroehlich commented 6 months ago

btw: you can test this with a calling workflow, where you specifiy your repo for the reusable workflow.

fmauch commented 6 months ago

I'll play around with that...

christophfroehlich commented 6 months ago

it seems that v4 has lots of issues, and similar reported errors https://github.com/codecov/codecov-action/issues/1292 should we downgrade it to v4 until it get certainly fixed upstream?

fmauch commented 6 months ago

Without the custom path I got this working: https://app.codecov.io/gh/fmauch/control_toolbox/tree/test_coverage with corresponding https://github.com/fmauch/control_toolbox/actions/runs/8086437364/job/22096586430 and https://github.com/fmauch/control_toolbox/blob/test_coverage/.github/workflows/build-coverage.yml

christophfroehlich commented 6 months ago

Let's check if this works also from forks: https://github.com/fmauch/control_toolbox/pull/1 I configured the other repos with secrets: inherit, I'm not sure where the advantages are..

fmauch commented 6 months ago

Let's check if this works also from forks: fmauch/control_toolbox#1 I configured the other repos with secrets: inherit, I'm not sure where the advantages are..

https://github.com/fmauch/control_toolbox/actions/runs/8095478742/attempts/1: "Secret CODECOV_TOKEN is required, but not provided while calling."

I can update this PR to not requiring it as an input and see whether inheriting works.

fmauch commented 6 months ago

Yep, that seems to be working: https://github.com/fmauch/control_toolbox/actions/runs/8095478742/job/22122490451

christophfroehlich commented 6 months ago

Great:

info - 2024-02-29 12:01:35,886 -- The PR is happening in a forked repo. Using tokenless upload.

You changed now my PR for ros-controls/control_toolbox. but let's merge this one first. We always can revert it ;)

fmauch commented 6 months ago

You changed now my PR for ros-controls/control_toolbox. but let's merge this one first. We always can revert it ;)

Ah sorry, I didn't realize you were using the same branch. for creating the PR at my fork.

Regarding the inherit vs. explicitly passing in the secret: When passing in the secret explicitly, the workflow could potentially be reused outside of the ros-controls organization. But for the moment I would also be fine with doing it that way.