ci: add Codecov Test Analytics via cargo-nextest#13
Conversation
Replace `cargo test` with `cargo nextest run --profile ci` in the test matrix and add a nextest `ci` profile that emits JUnit XML. nextest is installed in CI via taiki-e/install-action, matching how cargo-llvm-cov and cargo-hack are already provisioned.
Add a codecov/test-results-action@v1 step that uploads the JUnit report from the nextest `ci` profile. Gated to ubuntu-latest so the three-OS matrix produces a single upload per run, and runs on failure (`!cancelled()`) so failing tests are still reported.
|
Warning Review limit reached
More reviews will be available in 47 minutes and 23 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds Nextest configuration for JUnit test output and updates the GitHub Actions CI workflow to install Nextest, run tests with a dedicated ChangesNextest and Codecov Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/rust.yml (1)
49-66:⚠️ Potential issue | 🟠 Major | ⚡ Quick winSet explicit least-privilege
permissionsfor the test job.This job currently relies on default token permissions. Declare minimal permissions explicitly to prevent over-privileged defaults.
Suggested change
test: name: Test (${{ matrix.os }}) needs: [setup, fmt, clippy, msrv] runs-on: ${{ matrix.os }} + permissions: + contents: read🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/rust.yml around lines 49 - 66, The test job "test" relies on default token permissions; add an explicit least-privilege permissions block at the job level (under the job named "test") to avoid over‑privileged defaults—for example add permissions: contents: read (and only other minimal scopes you actually need, avoid write scopes). Place this permissions mapping directly under the test job declaration so the job (and steps like checkout and running cargo nextest) run with minimal rights and the Codecov upload still uses the provided secret token.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/rust.yml:
- Line 59: The workflow uses tag-based action refs
(taiki-e/install-action@nextest and codecov/test-results-action@v1); replace
those with immutable commit SHAs: find the corresponding GitHub Action
repositories (taiki-e/install-action and codecov/test-results-action), copy the
exact commit SHA you want to pin from their default branch, and update the uses
lines to taiki-e/install-action@<commit-sha> and
codecov/test-results-action@<commit-sha>; ensure both occurrences in the
rust.yml are updated and optionally add a short comment with the pinned SHA and
date.
---
Outside diff comments:
In @.github/workflows/rust.yml:
- Around line 49-66: The test job "test" relies on default token permissions;
add an explicit least-privilege permissions block at the job level (under the
job named "test") to avoid over‑privileged defaults—for example add permissions:
contents: read (and only other minimal scopes you actually need, avoid write
scopes). Place this permissions mapping directly under the test job declaration
so the job (and steps like checkout and running cargo nextest) run with minimal
rights and the Codecov upload still uses the provided secret token.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 599f63d0-31ba-42fa-b2b8-177c9d0df3c4
📒 Files selected for processing (2)
.config/nextest.toml.github/workflows/rust.yml
codecov/test-results-action is deprecated; switch to codecov-action@v5 with report_type: test_results, matching the coverage job's action and token style.
Codecov Report✅ All modified and coverable lines are covered by tests. |
Public repo uploads are tokenless via GitHub Actions OIDC.
Generate JUnit XML with cargo-nextest and upload it to Codecov Test Analytics.
Summary by CodeRabbit
nextestfor improved test execution and reporting.