Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup default lighthouse ci
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Khare <khareyash05@gmail.com>
khareyash05 committed Dec 16, 2024
1 parent 40ed80a commit 21e9830
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -13,11 +13,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: npm install, build
- name: Install dependencies
run: |
npm install
npm run build
- name: run Lighthouse CI
run: |
npm install -g @lhci/cli@0.14.x
lhci autorun --upload.target=temporary-public-storage || echo "LHCI failed!"
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v7
with:
urls: http://localhost:3000
budgetPath: ./budget.json
uploadArtifacts: true # save results as an action artifacts
temporaryPublicStorage: true # upload lighthouse audits to google temporary storage
12 changes: 5 additions & 7 deletions lighthouserc.json
Original file line number Diff line number Diff line change
@@ -6,18 +6,16 @@
"collect": {
"startServerCommand": "npm run dev",
"url": [
"http://localhost:3000/",
"http://localhost:3000/api-testing"
"http://localhost:3000/"
]
},
"assert": {
"assertions": {
"categories:performance": ["error", {"minScore": 0.8}],
"first-contentful-paint": ["error", {"maxNumericValue": 2000}],
"interactive": ["error", {"maxNumericValue": 5200}],
"speed-index": ["error", {"maxNumericValue": 4300}],
"resource-summary:script:size": ["error", {"maxNumericValue": 170000}],
"resource-summary:total:size": ["error", {"maxNumericValue": 300000}]
"categories:accessibility": ["error", {"minScore": 0.8}],
"categories:best-practices": ["error", {"minScore": 0.8}],
"categories:seo": ["error", {"minScore": 0.8}],
"csp-xss": "warn"
}
}
}

0 comments on commit 21e9830

Please sign in to comment.