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

use codecov actions to upload instead of the cli #42

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

matt-codecov
Copy link
Contributor

tl;dr:

  • use regular codecov actions to upload coverage and test results, not the cli
  • use a matrixed job to upload coverage/junit files to each of our environments concurrently

worker, shared, and API run their tests inside containers, but those containers all bindmount the working directory into the container. so when the tests write junit/coverage files, those files are visible outside of the container as well. this PR uploads those files with upload-artifact

a separate job uses download-artifact + a matrix to submit up to four uploads ({unit, integration} {coverage, junit}) to codecov in each of our four environments

run-tests-split.yml presents an extra complication. the tests are themselves run in a matrix and produce several output files. i've done a few things to deal with that:

  • dynamically build the matrix for the test job based on the passed-in number of groups to split into, so now you can actually use the workflow with different split sizes
  • assumed that each test job will include its group number in its output filenames. so for example: unit.4.coverage.xml, integration.2.junit.xml
  • added the group index to the uploaded artifacts' keys as well, and used the pattern argument for download-artifact to download them all in one go
  • provided globs to the files arg in the action, which i think will work

@matt-codecov matt-codecov force-pushed the matt/use-codecov-action branch 8 times, most recently from 857dfae to 153d6c6 Compare February 14, 2025 19:18
@matt-codecov matt-codecov force-pushed the matt/use-codecov-action branch 3 times, most recently from 038687b to 8c04f08 Compare February 19, 2025 19:27
@matt-codecov matt-codecov force-pushed the matt/use-codecov-action branch from 8c04f08 to 54543ce Compare February 19, 2025 19:54
@matt-codecov
Copy link
Contributor Author

matt-codecov commented Feb 19, 2025

okay after pushing a new release of the test results action (codecov/test-results-action#112) and then yanking a bad release of the CLI (https://pypi.org/project/codecov-cli/10.1.0/) this appears ready to go

Copy link
Contributor

@trent-codecov trent-codecov left a comment

Choose a reason for hiding this comment

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

LGTM

@matt-codecov matt-codecov merged commit 40e7f63 into main Feb 19, 2025
1 check passed
@matt-codecov matt-codecov deleted the matt/use-codecov-action branch February 19, 2025 21:12
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.

3 participants