Repository navigation
Commit 284899c
authored
ci: upload Rust coverage to GitHub (#1164)
* ci: upload Rust coverage to GitHub
Add a dedicated CI job that generates Cobertura XML from the Rust workspace with cargo-llvm-cov and uploads it through GitHub Code Coverage.
The job runs only for pull requests and default-branch pushes after the existing code-change detector passes, which gives GitHub Code Quality both PR coverage data and a default-branch baseline without adding work to docs-only changes.
Add cargo-llvm-cov and the llvm-tools-preview component to the Nix-backed toolchain so local and CI environments can produce the report reproducibly.
* ci: pin coverage upload action
Pin actions/upload-code-coverage to the current v1 commit SHA so the job follows the repository pattern of immutable GitHub Action references.
Add an explicit timeout to the coverage job to avoid unbounded runner usage if coverage generation or upload stalls.
* ci: make coverage upload best effort
Keep generating the Rust Cobertura report and invoking GitHub Code Coverage, but do not fail the whole CI run when the public preview API returns an upload error.
The current upload endpoint returns HTTP 404 for this repository even though coverage generation succeeds, which indicates the preview API is not available for the repository yet. The workflow will surface the upload error annotation while allowing the rest of CI to stay green.
Grant pull-requests: read for the action path that resolves PR numbers during push events.
* ci: fold coverage into test job
Run Rust coverage from the existing test job on pull requests and default-branch pushes so CI does not execute the Rust test suite twice.
The test job now runs Vitest separately when coverage is enabled, then uses cargo-llvm-cov as the Rust test execution path before uploading the Cobertura report. Non-coverage branch pushes keep the existing pnpm run test path.
Keep the upload permissions and best-effort error handling in the test job because GitHub Code Coverage may return preview API errors before the repository-side feature is fully available.1 parent ae09518 commit 284899c
3 files changed
Lines changed: 33 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
47 | 77 | | |
48 | 78 | | |
49 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
0 commit comments