Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughRenames workflow step IDs/outputs to kebab-case, switches CI test command to Changes
Sequence Diagram(s)sequenceDiagram
participant GH as "GitHub Actions"
participant Runner as "CI Runner"
participant Jest as "Jest (CI config)"
participant Artifact as "Actions Artifact Service"
participant Publish as "Publish Job"
participant Codecov as "Codecov"
GH->>Runner: start build-and-test job
Runner->>Jest: run `npm run -s test:ci`
Jest-->>Runner: emit coverage (test-results/lcov.info) and junit XML
Runner->>Artifact: upload `test-results.zip` (if not cancelled)
Runner->>Runner: create npm package -> output `package-file`
Runner-->>GH: set job outputs (`package-file`, `tests-ran`, `tests-passed`)
GH->>Publish: downstream reads `needs.build-and-test.outputs.package-file`
GH->>Codecov: download `test-results.zip` (upload test results always if not cancelled)
GH->>Codecov: upload coverage (only if `tests-passed`) (use_oidc: true)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 852a6a99-d4d5-4b8d-8106-0e9e8b4af039
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.github/workflows/build-and-test.yml.npmignoreREADME.mdcodecov.ymljest.config.ci.jsjest.config.jspackage.json
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1bb2b54b-c4d7-4920-952d-5146517f1d2c
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.github/workflows/build-and-test.yml.npmignoreREADME.mdcodecov.ymljest.config.ci.jsjest.config.jspackage.json
✅ Files skipped from review due to trivial changes (4)
- .npmignore
- jest.config.js
- codecov.yml
- jest.config.ci.js
🚧 Files skipped from review as they are similar to previous changes (2)
- README.md
- package.json
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-and-test.yml (1)
78-90: Specify coverage and test result file paths explicitly for Codecov uploads.The Codecov action steps rely on file discovery. Since the CI configuration writes fixed outputs, passing explicit
filesparameters would make uploads deterministic and prevent silent no-ops if the pinned action version does not discover these files.Suggested change
- name: Upload coverage report to Codecov # codecov/codecov-action@v6.0.0 uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 with: + files: coverage/lcov.info use_oidc: true - name: Upload test results to Codecov if: ${{ !cancelled() }} # codecov/codecov-action@v6.0.0 uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 with: + files: coverage/junit.xml use_oidc: true report_type: test_results
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c63a1b79-662b-42d8-a965-a48952ef68de
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.github/workflows/build-and-test.yml.npmignoreREADME.mdcodecov.ymljest.config.ci.jsjest.config.jspackage.json
✅ Files skipped from review due to trivial changes (5)
- .npmignore
- README.md
- codecov.yml
- jest.config.js
- jest.config.ci.js
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/build-and-test.yml (1)
66-73:⚠️ Potential issue | 🟠 MajorPropagate
run-testsstate through the new artifact/Codecov flow.Line 68 only uploads
test-results/whenrun-testsitself failed, while Line 139 starts the downstream job on any non-cancelledbuild-and-testfailure. That combination creates three bad paths: post-test failures skip the artifact even though the reports exist, pre-test failures turndownload-artifactinto a second job failure, and Line 152 uploads coverage after failed tests.Use
steps.run-tests.outcomefor the artifact step, export explicittests-ran/tests-passedoutputs frombuild-and-test, gate the downstream job ontests-ran, and gate Line 152 ontests-passed.One way to wire the states explicitly
outputs: package-file: ${{ steps.create-npm-package.outputs.package-file }} + tests-ran: ${{ steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure' }} + tests-passed: ${{ steps.run-tests.outcome == 'success' }} @@ - name: Upload tests results artifact - if: ${{ success() || (failure() && steps.run-tests.outcome == 'failure') }} + if: ${{ !cancelled() && (steps.run-tests.outcome == 'success' || steps.run-tests.outcome == 'failure') }} uses: actions/upload-artifact@v7 @@ upload-test-results-to-codecov: - if: ${{ !cancelled() }} + if: ${{ !cancelled() && needs.build-and-test.outputs.tests-ran == 'true' }} @@ - name: Upload coverage report to Codecov + if: ${{ needs.build-and-test.outputs.tests-passed == 'true' }} # codecov/codecov-action@v6.0.0 uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2Based on learnings: Codecov coverage uploads in this repo should stay success-only; only the
report_type: test_resultsupload should run under!cancelled().Also applies to: 134-164
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d50e22b4-94f3-4c9a-89fc-820a31453abd
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
.github/workflows/build-and-test.yml.github/workflows/sonarqube-analysis.yml.gitignore.npmignoreREADME.mdcodecov.ymljest.config.ci.jsjest.config.jspackage.jsonsonar-project.properties
✅ Files skipped from review due to trivial changes (5)
- sonar-project.properties
- .gitignore
- README.md
- .npmignore
- codecov.yml
🚧 Files skipped from review as they are similar to previous changes (3)
- jest.config.js
- jest.config.ci.js
- package.json
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d04ea937-9ebd-405c-81b1-398a8bb7e874
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
.github/workflows/build-and-test.yml.github/workflows/sonarqube-analysis.yml.gitignore.npmignoreREADME.mdcodecov.ymljest.config.ci.jsjest.config.jspackage.jsonsonar-project.properties
✅ Files skipped from review due to trivial changes (7)
- .gitignore
- sonar-project.properties
- .npmignore
- jest.config.js
- README.md
- codecov.yml
- jest.config.ci.js
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/sonarqube-analysis.yml
- package.json
- Try to upload test results artifact even when "Run tests" step fails. - Add a job to upload Codecov reports to the "Build and Test" workflow. - Change the default Jest config to enable only `lcov` and `text` coverage reporters. - Change the default Jest config to store output in the `test-results` folder instead of the `coverage` one. - Introduce `test:ci` script with CI-specific Jest config: - use the `summary` reporter instead of the `default` one; - add the `github-actions` reporter; - add the `jest-junit` reporter with Codecov recommended config; - enable only `lcov` and `text-summary` coverage reporters.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-and-test.yml (1)
156-170: Consider specifying explicitfilespaths for clarity and reliability.While Codecov's auto-discovery should find the coverage and test result files, explicitly specifying paths prevents potential discovery issues and makes the configuration self-documenting.
♻️ Optional: Explicit file paths
- name: Upload coverage report to Codecov # Only upload coverage report when tests pass as it may be incomplete otherwise if: ${{ needs.build-and-test.outputs.tests-passed == 'true' }} # codecov/codecov-action@v6.0.0 uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 with: use_oidc: true + files: test-results/lcov.info - name: Upload test results to Codecov if: ${{ !cancelled() }} # codecov/codecov-action@v6.0.0 uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 with: use_oidc: true report_type: test_results + files: test-results/junit.xml
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2431149f-76ce-432c-b1fd-4cbfaf6ed3ae
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
.github/workflows/build-and-test.yml.github/workflows/sonarqube-analysis.yml.gitignore.npmignoreREADME.mdcodecov.ymljest.config.ci.jsjest.config.jspackage.jsonsonar-project.properties
✅ Files skipped from review due to trivial changes (7)
- .npmignore
- jest.config.js
- .gitignore
- .github/workflows/sonarqube-analysis.yml
- README.md
- codecov.yml
- sonar-project.properties
🚧 Files skipped from review as they are similar to previous changes (1)
- jest.config.ci.js



Description
lcovandtextcoverage reporters.test:ciscript with CI-specific Jest config:summaryreporter instead of thedefaultone;github-actionsreporter;jest-junitreporter with Codecov recommended config;lcovandtext-summarycoverage reporters.Type of Change
Checklist
By submitting this pull request, I confirm that I have read and understood the contribution guidelines and that my contributions are my own work.