Skip to content
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

added lighthouse ci github action #111

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/lighthouse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lighthouse CI performance check
on: [push, pull_request]

jobs:
performance_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install dependencies
run: npm install

- name: Build website
run: npm run build --if-present

- name: Run Lighthouse against public directory
uses: treosh/lighthouse-ci-action@v3
with:
uploadArtifacts: true
temporaryPublicStorage: true
configPath: './lighthouserc.json'
runs: 3
19 changes: 19 additions & 0 deletions lighthouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"ci": {
"collect": {
"url": ["http://localhost/", "http://localhost/404/", "http://localhost/page-2"],
"staticDistDir": "./public"
},
"assert": {
"assertions": {
"categories:accessibility": ["error", { "minScore": 0.85 }],
"categories:best-practices": ["error", { "minScore": 0.8 }],
"categories:performance": ["error", { "minScore": 0.75 }],
"categories:seo": ["warn", { "minScore": 1 }],
"dom-size": ["warn", { "maxNumericValue": 1000 }],
"first-contentful-paint": ["error", { "maxNumericValue": 2500 }],
"interactive": ["error", { "maxNumericValue": 5000 }]
}
}
}
}