Skip to content

Commit aca4979

Browse files
committed
feat: lighthouse configuration
1 parent f0ca5bd commit aca4979

File tree

5 files changed

+3031
-79
lines changed

5 files changed

+3031
-79
lines changed

.github/workflows/lighthouse.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lighthouse
2+
on: push
3+
jobs:
4+
static-dist-dir:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Run Lighthouse against a static dist dir
9+
uses: treosh/lighthouse-ci-action@v11
10+
with:
11+
configPath: "./lighthouserc.json"

lighthouserc.cjs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
ci: {
3+
collect: {
4+
startServerCommand: "npm start",
5+
numberOfRuns: 3,
6+
url: ["http://localhost:4321/"],
7+
},
8+
upload: {
9+
target: "temporary-public-storage",
10+
},
11+
assert: {
12+
preset: 'lighthouse:recommended',
13+
assertions: {
14+
"categories:performance":
15+
["warn", {minScore: 0.8}],
16+
"categories.pwa": "off",
17+
},
18+
},
19+
settings: {
20+
onlyCategories: ["performance"],
21+
chromeFlags:
22+
"--headless --no-sandbox --disk-cache-size=0",
23+
"throttling-method": "devtools",
24+
throttling: {
25+
requestLatencyMs: 70,
26+
downloadThroughputKbps: 12000,
27+
cpuSlowdownMultiplier: 1,
28+
}
29+
}
30+
},
31+
};

lighthouserc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ci": {
3+
"collect": {
4+
"staticDistDir": "./dist"
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)