-
-
Notifications
You must be signed in to change notification settings - Fork 271
ci: emit test data to codecov + prevent failing status check #928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| # pnpm cache skipped deliberately as the project is not actually installed here | ||
|
|
||
|
|
@@ -49,7 +49,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| with: | ||
| cache: true | ||
|
|
@@ -71,7 +71,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| with: | ||
| cache: true | ||
|
|
@@ -80,7 +80,13 @@ jobs: | |
| run: pnpm install | ||
|
|
||
| - name: 🧪 Unit tests | ||
| run: pnpm test:unit --project unit run --coverage | ||
| run: pnpm test:unit run --coverage --reporter=junit --outputFile=test-report.junit.xml | ||
|
|
||
| - name: ⬆︎ Upload test results to Codecov | ||
| if: ${{ !cancelled() }} | ||
| uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
|
Comment on lines
+85
to
90
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/ci.yml | head -130Repository: npmx-dev/npmx.dev Length of output: 4668 🏁 Script executed: # Search for all Codecov-related steps in the workflow
rg -n "codecov" .github/workflows/ci.yml -i -A 3Repository: npmx-dev/npmx.dev Length of output: 876 🌐 Web query:
💡 Result:
Sources: 🌐 Web query:
💡 Result: For forked PRs, GitHub Actions won’t pass repository secrets (including Recommended setup (2 paths)1) Prefer tokenless uploads for fork PRs (public repos)Codecov supports tokenless uploads for public repos when token authentication is disabled for the org, and/or for fork PR commits on “unprotected” branches (the Codecov Action v4+ handles fork PR branch naming to make this work). (docs.codecov.com) Then use two steps: # Upload with token on non-fork PRs / pushes
- name: Upload coverage (trusted)
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Upload without token on fork PRs
- name: Upload coverage (fork PR - tokenless)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
uses: codecov/codecov-action@v52) If you require a token, skip entirely on forks- name: Upload coverage (skip on forks)
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}Note on “checking if the secret exists”GitHub notes secrets can’t be referenced directly in Citations:
Guard Codecov uploads on forked PRs using fork detection instead of secret checking. Secrets are not passed to forked PRs, and GitHub Actions does not allow direct secret references in if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork }}This applies to lines 85–90, 116–120, and also to lines 122–125 (which currently has no conditional guard at all). |
||
| test: | ||
| name: 🧪 Component tests | ||
|
|
@@ -93,7 +99,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| with: | ||
| cache: true | ||
|
|
@@ -105,12 +111,18 @@ jobs: | |
| run: pnpm playwright install chromium-headless-shell | ||
|
|
||
| - name: 🧪 Component tests | ||
| run: pnpm vite test --project nuxt run --coverage | ||
| run: pnpm test:nuxt run --coverage --reporter=junit --outputFile=test-report.junit.xml | ||
|
|
||
| - name: ⬆︎ Upload test results to Codecov | ||
| if: ${{ !cancelled() }} | ||
| uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload coverage reports to Codecov | ||
| - name: ⬆︎ Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5 | ||
| env: | ||
| CODECOV_TOKEN: 17b4bed9-d407-4ce2-9c10-2ccd4328a1d9 | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| browser: | ||
| name: 🖥️ Browser tests | ||
|
|
@@ -125,7 +137,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| with: | ||
| cache: true | ||
|
|
@@ -153,7 +165,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| with: | ||
| cache: true | ||
|
|
@@ -181,7 +193,7 @@ jobs: | |
| with: | ||
| node-version: lts/* | ||
|
|
||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| - uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c | ||
| name: 🟧 Install pnpm | ||
| with: | ||
| cache: true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| coverage: | ||
| status: | ||
| project: | ||
| default: | ||
| informational: true | ||
| patch: | ||
| default: | ||
| informational: true | ||
|
|
||
| comment: | ||
| layout: 'reach,diff,flags,tree,components,tests,build' | ||
| behavior: default | ||
| require_changes: false |
Uh oh!
There was an error while loading. Please reload this page.