Skip to content

fix(ci): set opt-level = 1 for ci codecov#6847

Merged
hanabi1224 merged 4 commits intomainfrom
hm/ci-codecov-opt-level
Apr 2, 2026
Merged

fix(ci): set opt-level = 1 for ci codecov#6847
hanabi1224 merged 4 commits intomainfrom
hm/ci-codecov-opt-level

Conversation

@hanabi1224
Copy link
Copy Markdown
Contributor

@hanabi1224 hanabi1224 commented Apr 2, 2026

Summary of changes

Changes introduced in this pull request:

  • run codecov with opt-level=1
  • disable unit-test CI workflow
  • move doc test to macos build check workflow

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Chores

    • Enhanced CI coverage pipeline: enabled build caching, split coverage collection/reporting, added a dedicated coverage build profile, and added test-results upload to Codecov.
    • Configured coverage generation to skip certain proof-parameter checks.
    • Removed legacy unit-test workflow to centralize test/coverage handling.
  • Tests

    • Reworked test orchestration: separated doctest execution from other runners and ensured docs tests run on macOS.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 2, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Update CI workflows and local task runner to split coverage collection: add a codecov Cargo profile, enable sccache and nextest tooling in coverage workflow, split llvm-cov runs into nextest/cargo/report via mise, run doctests on macOS via mise test:docs, and remove the standalone unit-tests workflow.

Changes

Cohort / File(s) Summary
Coverage workflow
.github/workflows/coverage.yml
Enable RUSTC_WRAPPER=sccache; add sccache env export and mozilla-actions/sccache-action; install taiki-e/install-action@nextest; run cargo llvm-cov with --profile codecov/--cargo-profile codecov; set FOREST_TEST_SKIP_PROOF_PARAM_CHECK=1 for mise codecov; add Codecov upload of target/nextest/default/junit.xml (non-failing on error).
macOS CI / mise
.github/workflows/forest.yml
Insert jdx/mise-action@v4 and run mise test:docs on macOS (doctests executed via mise).
Unit-tests workflow (removed)
.github/workflows/unit-tests.yml
Workflow file deleted (removes tests-release job and its SCCache/nextest/mise/test steps and Codecov JUnit upload).
Cargo build profiles
Cargo.toml
Add [profile.codecov] (based on dev) with opt-level = 1 and [profile.codecov.package."*"] overriding debug = false and opt-level = 1 for packages.
Task runner (mise)
mise.toml
Remove profile argument from tasks."test:docs" and stop invoking it from tasks.test; refactor tasks.codecov into codecov:nextest, codecov:cargo, and codecov:report to run llvm-cov for nextest and cargo then produce merged lcov.info.

Sequence Diagram(s)

sequenceDiagram
  participant GH as GitHub Actions
  participant SCC as sccache
  participant Install as Install actions
  participant Mise as mise action
  participant Nextest as nextest (tests)
  participant Cargo as cargo (tests)
  participant Codecov as Codecov

  GH->>SCC: export SCCACHE_* env & run mozilla-actions/sccache-action
  GH->>Install: install cargo-llvm-cov and nextest tooling
  GH->>Mise: run `mise codecov`
  Mise->>Nextest: run `cargo llvm-cov --no-report nextest --cargo-profile codecov`
  Nextest->>Mise: produce Nextest JUnit & coverage artifacts
  Mise->>Cargo: run `cargo llvm-cov test --profile codecov` for lib/package
  Cargo->>Mise: produce cargo coverage artifacts
  Mise->>Mise: merge coverage -> `lcov.info`
  GH->>Codecov: upload `target/nextest/default/junit.xml` (report_type: test_results)
  GH->>Codecov: upload merged `lcov.info`
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

github_actions

Suggested reviewers

  • akaladarshi
  • LesnyRumcajs
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: enabling opt-level = 1 for codecov builds. This is the main technical objective visible across the changeset (Cargo.toml profile addition and workflow adjustments).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hm/ci-codecov-opt-level
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch hm/ci-codecov-opt-level

Comment @coderabbitai help to get the list of available commands and usage tips.

@hanabi1224 hanabi1224 force-pushed the hm/ci-codecov-opt-level branch from 44c0366 to b5f5e25 Compare April 2, 2026 07:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.92%. Comparing base (bbaf243) to head (79c4208).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

see 17 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbaf243...79c4208. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hanabi1224 hanabi1224 force-pushed the hm/ci-codecov-opt-level branch 3 times, most recently from b88a4d2 to 34b273b Compare April 2, 2026 09:03
@hanabi1224 hanabi1224 marked this pull request as ready for review April 2, 2026 09:04
@hanabi1224 hanabi1224 requested a review from a team as a code owner April 2, 2026 09:04
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and akaladarshi and removed request for a team April 2, 2026 09:04
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
mise.toml (1)

221-227: Minor inconsistency: codecov task duplicates the report command instead of calling codecov:report.

The codecov task directly runs cargo llvm-cov report (line 226) instead of invoking the codecov:report task (lines 215-219). For consistency and DRY principles, consider using mise task run codecov:report.

♻️ Proposed refactor
 [tasks.codecov]
 description = "Generate codecov report"
 run = '''
 mise task run codecov:nextest
 mise task run codecov:cargo
-cargo llvm-cov report --profile codecov --codecov --output-path lcov.info
+mise task run codecov:report
 '''
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mise.toml` around lines 221 - 227, The tasks.codecov task duplicates the
cargo llvm-cov report step instead of reusing the existing codecov:report task;
update tasks.codecov to run the existing codecov:report task (i.e., replace the
direct "cargo llvm-cov report ..." invocation with "mise task run
codecov:report") while keeping the existing mise task runs for codecov:nextest
and codecov:cargo so the report generation logic is centralized in the
codecov:report task.
.github/workflows/unit-tests.yml (1)

44-49: Consider adding a comment explaining why this job is disabled.

The if: false pattern works but lacks context for future maintainers. If this is a permanent change (since coverage is now handled in coverage.yml), consider removing the job entirely. If temporary, add a comment explaining the reason and when it should be re-enabled.

   tests-release:
     runs-on: ubuntu-24.04-arm
     timeout-minutes: 45
-    # Run the job only if the PR is not a draft.
-    # This is done to limit the runner cost.
-    if: false
+    # Job disabled: unit tests coverage is now handled in coverage.yml workflow
+    # using the dedicated codecov profile. Remove this job if no longer needed.
+    if: false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/unit-tests.yml around lines 44 - 49, The tests-release job
is disabled via "if: false" without context; either remove the tests-release job
entirely if coverage is now permanently handled in coverage.yml, or leave it and
replace the bare "if: false" with a clear comment above the job explaining why
it’s disabled (reference coverage.yml), whether this is temporary, and the
criteria or date for re-enabling; ensure you update the tests-release job header
so future maintainers understand the intent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/unit-tests.yml:
- Around line 44-49: The tests-release job is disabled via "if: false" without
context; either remove the tests-release job entirely if coverage is now
permanently handled in coverage.yml, or leave it and replace the bare "if:
false" with a clear comment above the job explaining why it’s disabled
(reference coverage.yml), whether this is temporary, and the criteria or date
for re-enabling; ensure you update the tests-release job header so future
maintainers understand the intent.

In `@mise.toml`:
- Around line 221-227: The tasks.codecov task duplicates the cargo llvm-cov
report step instead of reusing the existing codecov:report task; update
tasks.codecov to run the existing codecov:report task (i.e., replace the direct
"cargo llvm-cov report ..." invocation with "mise task run codecov:report")
while keeping the existing mise task runs for codecov:nextest and codecov:cargo
so the report generation logic is centralized in the codecov:report task.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5db4f342-1c11-4661-bb73-5c931bb16477

📥 Commits

Reviewing files that changed from the base of the PR and between 48752c7 and 34b273b.

📒 Files selected for processing (5)
  • .github/workflows/coverage.yml
  • .github/workflows/forest.yml
  • .github/workflows/unit-tests.yml
  • Cargo.toml
  • mise.toml

@hanabi1224 hanabi1224 force-pushed the hm/ci-codecov-opt-level branch from 34b273b to 5fe1887 Compare April 2, 2026 09:12
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/unit-tests.yml (1)

47-49: Consider removing the disabled job instead of using if: false.

The static analysis tool (actionlint) correctly flags this as dead code. Since unit tests are now handled in coverage.yml, keeping this job disabled via if: false creates workflow clutter. Two options:

  1. If the job is obsolete: Remove the entire tests-release job (or the workflow file if no other jobs exist)
  2. If keeping for future re-enablement: Add a more detailed comment explaining under what conditions it would be re-enabled

Given the comment already suggests removal, option 1 seems appropriate.

🗑️ Suggested removal
-  tests-release:
-    runs-on: ubuntu-24.04-arm
-    timeout-minutes: 45
-    # Job disabled: unit tests coverage is now handled in coverage.yml workflow
-    # using the dedicated codecov profile. Remove this job if no longer needed.
-    if: false
-    steps:
-      - name: Configure SCCache variables
-        run: |
-          # External PRs do not have access to 'vars' or 'secrets'.
-          if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then
-            echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV
-            echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV
-            echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV
-          fi
-      - name: Checkout Sources
-        uses: actions/checkout@v6
-      - name: Setup sccache
-        uses: mozilla-actions/sccache-action@v0.0.9
-        timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
-        continue-on-error: true
-      - uses: actions/setup-go@v6
-        with:
-          go-version-file: "go.work"
-          cache-dependency-path: "**/go.sum"
-      - name: install nextest
-        uses: taiki-e/install-action@nextest
-      - uses: actions/cache@v5
-        id: cache-proof-params
-        with:
-          path: ${{ env.FIL_PROOFS_PARAMETER_CACHE }}
-          key: proof-params-keys
-      - uses: actions/cache@v5
-        id: cache-actor-bundle
-        with:
-          path: ${{ env.FOREST_ACTOR_BUNDLE_PATH }}
-          key: actor-bundle
-      - name: Fetch proof params and RPC test snapshots
-        run: |
-          cargo run --bin forest-dev --no-default-features --profile quick-test -- fetch-test-snapshots --actor-bundle $FOREST_ACTOR_BUNDLE_PATH
-          ls -ahl $FIL_PROOFS_PARAMETER_CACHE
-      - uses: jdx/mise-action@v4
-      - run: |
-          mise test
-        env:
-          FOREST_TEST_SKIP_PROOF_PARAM_CHECK: 1
-          # https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
-          CARGO_BUILD_JOBS: 3
-      - name: Upload Test Results to CodeCov
-        uses: codecov/codecov-action@v6
-        if: ${{ !cancelled() }}
-        with:
-          token: ${{ secrets.CODECOV_TOKEN }}
-          report_type: "test_results"
-          files: target/nextest/default/junit.xml
-          fail_ci_if_error: false
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/unit-tests.yml around lines 47 - 49, The disabled CI job
"tests-release" is left in the workflow behind an `if: false` guard; remove the
entire tests-release job block from the workflow (delete the job definition that
contains `if: false` and its steps) to eliminate dead code and workflow clutter,
or if you prefer to keep it for future use, replace the `if: false` with a clear
explanatory comment above the tests-release job that documents exactly when/how
it should be re-enabled; ensure the change targets the job named "tests-release"
and removes or documents all associated steps and metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mise.toml`:
- Around line 199-201: The tasks.test entry no longer runs doctests but its
existing description still says “Run all tests”; update the tasks.test
description (the description field under the tasks.test/TOML table) to
accurately state that it runs nextest/cargo unit and integration tests and
excludes doctests (or alternatively re-enable doctest execution), so
contributors aren’t misled—either change the description text to something like
“Run unit and integration tests (excludes doctests)” or restore doctest
invocation in the tasks.test task.

---

Nitpick comments:
In @.github/workflows/unit-tests.yml:
- Around line 47-49: The disabled CI job "tests-release" is left in the workflow
behind an `if: false` guard; remove the entire tests-release job block from the
workflow (delete the job definition that contains `if: false` and its steps) to
eliminate dead code and workflow clutter, or if you prefer to keep it for future
use, replace the `if: false` with a clear explanatory comment above the
tests-release job that documents exactly when/how it should be re-enabled;
ensure the change targets the job named "tests-release" and removes or documents
all associated steps and metadata.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2b263de3-93d0-4686-a7ba-dfcdc00062ac

📥 Commits

Reviewing files that changed from the base of the PR and between 34b273b and 5fe1887.

📒 Files selected for processing (5)
  • .github/workflows/coverage.yml
  • .github/workflows/forest.yml
  • .github/workflows/unit-tests.yml
  • Cargo.toml
  • mise.toml
🚧 Files skipped from review as they are similar to previous changes (3)
  • Cargo.toml
  • .github/workflows/forest.yml
  • .github/workflows/coverage.yml

Comment thread mise.toml
@hanabi1224 hanabi1224 force-pushed the hm/ci-codecov-opt-level branch from 5fe1887 to 3d43c15 Compare April 2, 2026 09:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/unit-tests.yml (1)

47-49: Prefer retiring this workflow over a permanent no-op job.

if: false disables the only job, but the Unit tests workflow still triggers on every PR/push and sticks around as dead config. If this disable is meant to stay, deleting the file or narrowing on: to workflow_dispatch only will keep Actions and required checks cleaner.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/unit-tests.yml around lines 47 - 49, The Unit tests
workflow currently contains an unconditional no-op gate (`if: false`) which
leaves a dead Actions workflow; either delete this workflow file to retire the
workflow entirely, or replace the broad `on:` triggers with a minimal trigger
(e.g., `workflow_dispatch`) so it only runs manually. Locate the `Unit tests`
workflow definition and remove the file or update the `on:` block to narrow
triggers, and also remove the `if: false` no-op condition if you choose to
retain the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/unit-tests.yml:
- Around line 47-49: The Unit tests workflow currently contains an unconditional
no-op gate (`if: false`) which leaves a dead Actions workflow; either delete
this workflow file to retire the workflow entirely, or replace the broad `on:`
triggers with a minimal trigger (e.g., `workflow_dispatch`) so it only runs
manually. Locate the `Unit tests` workflow definition and remove the file or
update the `on:` block to narrow triggers, and also remove the `if: false` no-op
condition if you choose to retain the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d9d9015e-5669-4f71-8499-a9775237ecd3

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe1887 and 3d43c15.

📒 Files selected for processing (5)
  • .github/workflows/coverage.yml
  • .github/workflows/forest.yml
  • .github/workflows/unit-tests.yml
  • Cargo.toml
  • mise.toml
✅ Files skipped from review due to trivial changes (1)
  • Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/coverage.yml

@hanabi1224 hanabi1224 marked this pull request as draft April 2, 2026 09:35
@hanabi1224 hanabi1224 force-pushed the hm/ci-codecov-opt-level branch 3 times, most recently from 48694a3 to 4cc818f Compare April 2, 2026 10:01
@hanabi1224 hanabi1224 marked this pull request as ready for review April 2, 2026 10:01
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/coverage.yml:
- Line 47: Change the unconditional workflow conditional that directly
references github.event.pull_request.draft to explicitly verify the event type
first; update the if condition (the existing "if" that uses
github.event.pull_request.draft) so it only checks draft when github.event_name
equals "pull_request" (i.e., combine an explicit event_name check with the
current draft check) to avoid accessing undefined pull_request context on non-PR
triggers.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 53834f99-2b64-4648-845d-35c187cdcdd0

📥 Commits

Reviewing files that changed from the base of the PR and between 3d43c15 and 4cc818f.

📒 Files selected for processing (5)
  • .github/workflows/coverage.yml
  • .github/workflows/forest.yml
  • .github/workflows/unit-tests.yml
  • Cargo.toml
  • mise.toml
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/forest.yml
  • Cargo.toml

Comment thread .github/workflows/coverage.yml
Comment thread .github/workflows/unit-tests.yml Outdated
Comment thread Cargo.toml
Comment thread mise.toml
@hanabi1224 hanabi1224 force-pushed the hm/ci-codecov-opt-level branch from 4cc818f to 83f780f Compare April 2, 2026 11:57
Comment thread .github/workflows/forest.yml
LesnyRumcajs
LesnyRumcajs previously approved these changes Apr 2, 2026
@hanabi1224 hanabi1224 enabled auto-merge April 2, 2026 22:26
@hanabi1224 hanabi1224 added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit fb2fbad Apr 2, 2026
35 checks passed
@hanabi1224 hanabi1224 deleted the hm/ci-codecov-opt-level branch April 2, 2026 22:46
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.

2 participants