Skip to content

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

Draft
ernst-dev wants to merge 1 commit into
mainfrom
feat/codecov-fork-upload
Draft

feat: upload fork pull request coverage to Codecov#171
ernst-dev wants to merge 1 commit into
mainfrom
feat/codecov-fork-upload

Conversation

@ernst-dev

@ernst-devernst-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.unit.config.mjs enables vitest coverage when CI === "true" and sets no reportsDirectory, so vitest writes to its default ./coverage. Note it sets no explicit reporter, so vitest defaults apply (text, html, clover, json) — there is no lcov, so the upload relies on clover.xml / coverage-final.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

codecovBot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (98c8ff0) to head (f21f967).

Additional details and impacted files
@@ Coverage Diff @@## main #171 +/- ##
=========================================
Coverage 100.00% 100.00% =========================================
Files 9 9 Lines 78 78 Branches 21 21 =========================================
Hits 78 78 

☔ 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.

Sign up for freeto 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

@ernst-dev