Skip to content

ci(dir): collect coverage and upload at once#1038

Merged
arpad-csepi merged 8 commits intomainfrom
ci/upload-codecov-at-once
Mar 17, 2026
Merged

ci(dir): collect coverage and upload at once#1038
arpad-csepi merged 8 commits intomainfrom
ci/upload-codecov-at-once

Conversation

@arpad-csepi
Copy link
Copy Markdown
Member

@arpad-csepi arpad-csepi commented Mar 11, 2026

This PR refactor the codecov coverage action by:

  • Use of OIDC instead of token
  • Remove default options as not needed
  • Remove fix coverage file name references
  • Collect all coverage results after tests and upload it when all tests are passed.
  • Simplify the coverage tasks in Taskfile.yml

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedMar 16, 2026, 4:45 PM

@github-actions github-actions bot added the size/S Denotes a PR that changes 50-199 lines label Mar 11, 2026
@arpad-csepi arpad-csepi force-pushed the ci/upload-codecov-at-once branch 20 times, most recently from e43892a to ccd04cf Compare March 13, 2026 17:45
@github-actions github-actions bot added size/M Denotes a PR that changes 200-999 lines and removed size/S Denotes a PR that changes 50-199 lines labels Mar 13, 2026
@arpad-csepi arpad-csepi force-pushed the ci/upload-codecov-at-once branch 3 times, most recently from bd8139f to 69be11f Compare March 13, 2026 18:05
@arpad-csepi arpad-csepi self-assigned this Mar 13, 2026
@arpad-csepi arpad-csepi linked an issue Mar 13, 2026 that may be closed by this pull request
2 tasks
@arpad-csepi arpad-csepi force-pushed the ci/upload-codecov-at-once branch from 28a3797 to 1fffce8 Compare March 13, 2026 19:24
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@arpad-csepi
Copy link
Copy Markdown
Member Author

The results from Codecov is not matching with the main:

this branch:
https://app.codecov.io/gh/agntcy/dir/blob/ci%2Fupload-codecov-at-once/cli%2Futil%2Freference%2Freference.go

main branch:
https://app.codecov.io/gh/agntcy/dir/blob/main/cli%2Futil%2Freference%2Freference.go

Need a bit investigation before merge.

@arpad-csepi arpad-csepi marked this pull request as ready for review March 13, 2026 21:37
@arpad-csepi arpad-csepi requested a review from a team as a code owner March 13, 2026 21:37
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
@arpad-csepi arpad-csepi force-pushed the ci/upload-codecov-at-once branch 2 times, most recently from f53433e to 69e514c Compare March 16, 2026 16:43
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
@arpad-csepi arpad-csepi force-pushed the ci/upload-codecov-at-once branch from 69e514c to 9b8c1f1 Compare March 16, 2026 16:44
Copy link
Copy Markdown
Member

@paralta paralta left a comment

Choose a reason for hiding this comment

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

Good work 🚀

echo "Running coverage tests in {{.ITEM}}"
go test -C {{.ITEM}} -covermode=atomic -coverprofile="{{.COVERAGE_DIR}}/unit/{{.ITEM}}.out" ./... > /dev/null

test:unit:coverage:local:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for e2e tests, we will not be able to see an equivalent report, right? we could potential remove this task but I am not against keeping it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The test:unit:coverage:local was part of the test:unit:coverage task before, but I moved out the filtering part which is needed only for local usage (as codecov.yml has a separate config for that). So test:unit:coverage:local is usable locally for unit tests coverage. The E2E tests needs a bit more work later to have inline with this kind of taskfile structure.

@arpad-csepi arpad-csepi merged commit f850de9 into main Mar 17, 2026
62 of 63 checks passed
@arpad-csepi arpad-csepi deleted the ci/upload-codecov-at-once branch March 17, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid wrong coverage statistic on Codecov

2 participants