Skip to content

Comments

ci: upload coverage to codecov#830

Merged
danielroe merged 1 commit intomainfrom
ci/codecov
Feb 3, 2026
Merged

ci: upload coverage to codecov#830
danielroe merged 1 commit intomainfrom
ci/codecov

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented Feb 3, 2026

resolves #589

@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 3, 2026 11:08am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Feb 3, 2026 11:08am
npmx-lunaria Ignored Ignored Feb 3, 2026 11:08am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The CI workflow configuration has been updated to consolidate testing steps. The unit test step has been renamed and its command modified to execute both unit and component tests simultaneously with coverage reporting using Vite. The previously separate component tests step has been removed. A new step for uploading coverage reports to Codecov has been added to the workflow. The net effect involves combining test execution into a single step whilst adding external coverage report integration.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description references issue #589 and the PR title indicates CI/Codecov coverage integration, which directly relates to the changeset that combines unit and component tests with Codecov coverage reporting.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/codecov

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

Copy link
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/ci.yml (1)

67-69: Consider adding the Codecov token for more reliable uploads and to support protected branches.

The codecov/codecov-action@v5 supports tokenless uploads for public repositories on unprotected branches, but a token is required for protected branches (such as main) in public repositories and is mandatory for private repositories. Even for unprotected branches, adding the token improves upload reliability and prevents rate-limiting issues.

♻️ Proposed improvement
      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
+       with:
+         token: ${{ secrets.CODECOV_TOKEN }}

Comment on lines +64 to +65
- name: 🧪 Unit and component tests
run: pnpm vite test run --coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incorrect command: vite does not have a test subcommand.

The command pnpm vite test run --coverage is invalid. vite is the build tool; the test runner is vitest. This will fail at runtime.

🐛 Proposed fix
       - name: 🧪 Unit and component tests
-        run: pnpm vite test run --coverage
+        run: pnpm vitest run --coverage

Alternatively, if there's an existing npm script:

       - name: 🧪 Unit and component tests
-        run: pnpm vite test run --coverage
+        run: pnpm test:unit --coverage
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: 🧪 Unit and component tests
run: pnpm vite test run --coverage
- name: 🧪 Unit and component tests
run: pnpm vitest run --coverage

@danielroe danielroe merged commit 415728e into main Feb 3, 2026
17 checks passed
@danielroe danielroe deleted the ci/codecov branch February 3, 2026 11:22
@serhalp
Copy link
Member

serhalp commented Feb 3, 2026

@danielroe 👀 this doesn't appear to be working. You'll need to log in to Codecov and get the token to include in the CI workflow, I think.

See https://github.com/npmx-dev/npmx.dev/actions/runs/21633953817/job/62353964912#step:9:269:

info - 2026-02-03 14:23:44,772 -- Found 2 coverage files to report
info - 2026-02-03 14:23:44,772 -- > /home/runner/work/npmx.dev/npmx.dev/coverage/coverage-final.json
info - 2026-02-03 14:23:44,772 -- > /home/runner/work/npmx.dev/npmx.dev/coverage/clover.xml
info - 2026-02-03 14:23:45,125 -- Process Upload complete
error - 2026-02-03 14:23:45,126 -- Upload failed: {"message":"Token required because branch is protected"}

@danielroe
Copy link
Member Author

this is what codecov tells me:

SCR-20260203-nqso

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.

add test coverage reporting in CI

2 participants