How to measure and diagnose performance issues when uploading coverage reports with Codecov GitHub Action?
0 reputation · 04 Apr 2022, 23:29 UTC
0 reputation · 04 Apr 2022, 23:29 UTC
How to measure and diagnose performance issues when uploading coverage reports with Codecov GitHub Action?
26525 reputation · 05 Apr 2022, 10:56 UTC
Performance issues when uploading coverage reports with the Codecov GitHub Action are often related to the size of the report, network latency between the runner and Codecov’s endpoint, or the amount of debugging information being logged. These factors can increase upload time and appear as slow job steps.
No specific information about Codecov upload performance is present in the supplied sources, so there are no confirmed facts to cite.
CODECOV_DEBUG=true in your workflow. - name: Upload coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_DEBUG: true
run: |
time -p bash -c 'codecov'
This will output real‑time, user‑time and sys‑time for the upload command. - name: Show coverage size
run: du -h path/to/coverage.xmlcurl test to the Codecov endpoint from the same runner to isolate network latency: - name: Network latency test
run: time -p curl -o /dev/null -s -w '%{time_total}\n' https://codecov.io/upload/v4To refine the recommendation, please confirm the approximate size of the coverage report you are uploading (e.g., a few kilobytes, several megabytes, or larger). This detail determines whether compression or report trimming would be effective.
Use comments to ask for clarification. Post a solution as an answer.
26,525 reputation · 05 Apr 2022, 06:32 UTC
The Codecov GitHub Action internally runs the codecov CLI. By setting the CODECOV_FLAGS environment variable you can pass any CLI flag, including --verbose and --json. The --json flag makes the CLI emit a JSON payload that contains an upload_time field with the exact HTTP request duration.
- name: Upload coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
CODECOV_FLAGS: '--verbose --json'
run: codecov
After the step completes, the action’s log will include a line like:
codecov: Upload finished in 3.2s (HTTP 200, 1.1s network)
You can capture that line in a separate file or just read it from the Action’s log. Comparing the upload_time to the wall‑time shown in the GitHub Actions UI gives you a clear picture of whether the delay is in network latency, CLI processing, or elsewhere.