Added a Github Action to automate running tests as part of the CI workflow#2
Conversation
xingzhang-suse
left a comment
There was a problem hiding this comment.
This PR is for integrating CI test into github actions, but the codecov is still pending, right?
package.json
Outdated
| "@rancher/components": "^0.3.0-alpha.1", | ||
| "@rancher/shell": "^3.0.4", | ||
| "vue": "^3.5.13", | ||
| "vue": "^3.2.13", |
There was a problem hiding this comment.
Could you clarify the reason to downgrade Vue's version?
There was a problem hiding this comment.
The "@rancher/components": "^0.3.0-alpha.1" supports up to Vue v3.2.13.
package.json
Outdated
| "serve-pkgs": "./node_modules/@rancher/shell/scripts/serve-pkgs", | ||
| "publish-pkgs": "./node_modules/@rancher/shell/scripts/extension/publish", | ||
| "parse-tag-name": "./node_modules/@rancher/shell/scripts/extension/parse-tag-name", | ||
| "test": "jest --config=jest.config.ts", |
There was a problem hiding this comment.
You can replace "test:ci"
c300ac7 to
8f80d27
Compare
holyspectral
left a comment
There was a problem hiding this comment.
Generally looks good to me. For codecov to work you'd need to get its token setup. We can discuss this offline.
.github/workflows/test.yml
Outdated
| name: Workflow for security-ui-exts | ||
| on: [push, pull_request] | ||
| jobs: | ||
| run: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: Set up Node 20 | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 20 | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Run tests and collect coverage | ||
| run: npm run test:ci | ||
| - name: Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} No newline at end of file |
There was a problem hiding this comment.
I'd recommend renaming it as ci.yml. This will sync with other projects and we can add other steps later, e.g., linter.
I saw -> Token of length 0 detected in your log. Have you added CODECOV_TOKEN secret to neuvector/security-ui-exts repo?
|
I've added the token. The change in this PR works well in this test PR and this run |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 1
Lines ? 31
Branches ? 0
========================================
Hits ? 31
Misses ? 0
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ddf79f7 to
d4bd1cd
Compare

No description provided.