Repository navigation
Add CI workflow for testing and building project #109
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 |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| # The workflow only checks out code and runs tests; it never needs write access. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: 'npm' | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 | ||
| with: | ||
| php-version: '8.3' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
|
|
||
| - name: Build production bundle | ||
| run: npm run build | ||
|
|
||
| - name: Install Playwright Chromium | ||
| run: npx playwright install chromium --with-deps | ||
|
|
||
| - name: Run browser tests | ||
| run: npm run test:ui | ||
|
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.
On every PR and push to Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 44
Comment:
**Browser test scripts are missing**
On every PR and push to `main`, this step runs `test:ui`, which is not defined in `package.json`. npm exits with “Missing script,” so the CI job cannot pass. The `test:accessibility` step on line 47 has the same problem.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
|
|
||
| - name: Run accessibility modal tests | ||
| run: npm run test:accessibility | ||
|
Comment on lines
+43
to
+47
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. 🔴 Missing browser scripts fail every CI run Every run reaches Learn moreThe workflow calls two npm scripts that are not defined in scripts. The first missing script makes npm exit nonzero, so the job never reaches later steps. The repository has a browser test at test-key-storage, but it uses a different script name and does not cover the accessibility tests named here. Example: A pull request reaches Recommended fix: Add real Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| - name: Run deploy guard | ||
| run: npm run test:deploy-guard | ||
|
|
||
| - name: Run proxy allowlist tests | ||
| run: npm run test:proxies | ||
|
|
||
| - name: Scan production bundle for API key/endpoint leaks | ||
| run: python3 scripts/scan_bundle_for_leaks.py | ||
|
Comment on lines
+55
to
+56
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. 🔴 Missing bundle scanner blocks CI completion Once earlier steps pass, Learn moreThe final step invokes a Python script that does not exist under Example: After defining both browser-test npm scripts, a run passes the proxy tests and reaches the scan step. Python exits with Recommended fix: Commit the intended scanner before enabling this step, or remove the step until the scanner exists. Run the full job after fixing the earlier missing scripts. Was this helpful? React with 👍 or 👎 to provide feedback.
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.
If the job reaches this step, Python cannot open Source Used: Linear — U2 — Gate main with required CI checks and branch protection Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 56
Comment:
**Bundle scanner file is missing**
If the job reaches this step, Python cannot open `scripts/scan_bundle_for_leaks.py` because the file is not in the repository. CI fails, and the intended bundle-leak check never runs. Greptile automatically discovered a related ticket stating that CI must fail when provider API key patterns appear in the client bundle, which informed this comment.
**Source Used:** Linear — [U2 — Gate main with required CI checks and branch protection](https://linear.app/stuart-gardoll/issue/STU-345/u2-gate-main-with-required-ci-checks-and-branch-protection)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow installs Chromium but never runs the existing
test:key-storagecheck.npm testruns onlysrc/*.test.js, so once the broken browser-test steps are fixed, CI can pass without checking credential persistence, encryption-key protection, or migration behavior. Include the existing check in the browser gate.Knowledge Base Used: Release and integration verification
Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!