Skip to content

feat: upload fork pull request coverage to Codecov - #166

Draft
ernst-dev wants to merge 2 commits into
mainfrom
feat/codecov-fork-upload
Draft

feat: upload fork pull request coverage to Codecov#166
ernst-dev wants to merge 2 commits into
mainfrom
feat/codecov-fork-upload

Conversation

@ernst-dev

@ernst-dev ernst-dev commented Aug 25, 2026

Copy link
Copy Markdown
Member

Change

Adds a thin workflow_run wrapper that calls the privileged reusable workflow in cloudscape-design/actions, restoring Codecov coverage for fork pull requests. Fork PRs run without secrets, so CODECOV_TOKEN is unavailable and the upload cannot happen from the build job.

This mirrors the existing deploy-fork-preview.yml wrapper in this repository — same filename convention, trigger shape, workflow-level permissions, job naming and secrets: inherit — so the fork-preview and fork-coverage flows now cover the same repositories. No with: is passed because the reusable workflow's artifact-name input defaults to coverage-report.

All privileged logic lives in cloudscape-design/actions; this file is only the rollout unit. It never checks out or executes fork code.

Verified for this repo, not assumed

The caller workflow's name: is exactly Build, lint and test, matching this wrapper's workflow_run.workflows entry. workflow_run matches on workflow name, so a mismatch would silently never fire.

coverage/ is confirmed as the correct output path: vite.config.unit.mjs enables vitest coverage when CI === "true" and sets no reportsDirectory, so vitest writes to its default ./coverage. Configured reporters are clover, lcov, html and json.

Rollout order

cloudscape-design/actions#131 has already landed (d3eca61 on main), so codecov-fork-upload.yml@main resolves and this wrapper has no pending prerequisite. It does not depend on cloudscape-design/actions#132 either: that PR only adds an optional coverage-artifact-name input for matrix callers, and the default this wrapper relies on is unchanged.

The upstream workflow uploads to Codecov for real, and runs with continue-on-error: true, so a failure there can never block a pull request. The attribution risk and the first-run checks are documented in #131; they are not duplicated here.

Must never be a required status check

This workflow deliberately does not run on merge_group (it only triggers on workflow_run of a pull request build). Adding it as a required status check would deadlock the merge queue.

Context: cloudscape-design/actions#131, cloudscape-design/build-tools#78.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.79%. Comparing base (ed86672) to head (0a4a94d).

❌ Your project check has failed because the head coverage (87.79%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #166   +/-   ##
=======================================
  Coverage   87.79%   87.79%           
=======================================
  Files          25       25           
  Lines         344      344           
  Branches       95       92    -3     
=======================================
  Hits          302      302           
  Misses         42       42           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The shared codecov-fork-upload workflow requests pull-requests: read for its
pull request resolver step. A called reusable workflow's permissions must be a
subset of the caller's, so granting only actions and contents made the call
fail workflow validation before any job ran.
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.

1 participant