-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/ci html budgets #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b69980d
Add budgets, HTML report, and CI workflow
Agent-Hellboy d2037ca
Fix regex parsing and crop robustness
Agent-Hellboy cc2a7fd
Modularize audits and evaluation
Agent-Hellboy e547398
Reduce dead-link and lazy image false positives
Agent-Hellboy 53a3950
Reduce crop failures and stabilize scroll state
Agent-Hellboy 8681e09
Resolve review comments and harden CI
Agent-Hellboy 12e7eec
Refactor audit flow into pipeline
Agent-Hellboy 443ee66
refactor: organize src structure
Agent-Hellboy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: | ||
| - 'v*.*.*' | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Install Playwright browsers (chromium only) | ||
| run: npx playwright install chromium --with-deps | ||
| - name: Smoke run against example.com | ||
| run: npm run smoke | ||
| - name: Upload smoke artifacts (report + shots) | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: smoke-artifacts | ||
| path: | | ||
| /tmp/uxray-ci.json | ||
| /tmp/uxray-shots | ||
|
|
||
| publish: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| registry-url: https://registry.npmjs.org | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Publish to npm | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: npm publish --provenance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env node | ||
| const os = require('os'); | ||
| const path = require('path'); | ||
| const { spawnSync } = require('child_process'); | ||
|
|
||
| const outFile = path.join(os.tmpdir(), 'uxray-ci.json'); | ||
| const shotsDir = path.join(os.tmpdir(), 'uxray-shots'); | ||
|
|
||
| const args = [ | ||
| path.join(__dirname, '..', 'ui-review.js'), | ||
| '--url', 'https://example.com', | ||
| '--steps', '1', | ||
| '--wait', '800', | ||
| '--wait-until', 'load', | ||
| '--target-policy', 'wcag21-aaa', | ||
| '--out', outFile, | ||
| '--shots', shotsDir, | ||
| ]; | ||
|
|
||
| const result = spawnSync('node', args, { stdio: 'inherit' }); | ||
| process.exit(result.status === null ? 1 : result.status); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| const { AxeBuilder } = require('@axe-core/playwright'); | ||
|
|
||
| async function runAxe(page, { axeTags }) { | ||
| let builder = new AxeBuilder({ page }); | ||
| if (axeTags && Array.isArray(axeTags) && axeTags.length) { | ||
| builder = builder.withTags(axeTags); | ||
| } | ||
| const results = await builder.analyze(); | ||
| return { | ||
| summary: { | ||
| violations: results.violations.length, | ||
| passes: results.passes.length, | ||
| incomplete: results.incomplete.length, | ||
| }, | ||
| topViolations: results.violations.slice(0, 10).map((v) => ({ | ||
| id: v.id, | ||
| description: v.description, | ||
| impact: v.impact, | ||
| help: v.help, | ||
| nodes: v.nodes.slice(0, 4).map((n) => ({ target: n.target, summary: n.failureSummary })), | ||
| })), | ||
| }; | ||
| } | ||
|
|
||
| module.exports = { | ||
| runAxe, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: Agent-Hellboy/UXRay
Length of output: 224
🏁 Script executed:
Repository: Agent-Hellboy/UXRay
Length of output: 808
Add timeout + explicit spawn error handling for CI reliability.
Line 20 runs a blocking child process without timeout. If the test or underlying Playwright process hangs, this can stall the CI job until the global workflow timeout. Additionally, line 21 does not check
result.error, which means spawn failures (e.g.,ENOENT, permission issues) go undiagnosed in logs.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents