Skip to content

Commit

Permalink
chore(CI): add Lighthouse Test on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed Dec 31, 2023
1 parent 5989588 commit b2b1ed0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/lighthouse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"ci": {
"collect": {
"numberOfRuns": 3,
"startServerCommand": "serve dist/",
"url": [
"http://localhost:3000/",
"http://localhost:3000/blog",
"http://localhost:3000/blog/2020/05/blanktar-renewal",
"http://localhost:3000/blog/2020/11/powershell-unique-value-count",
"http://localhost:3000/works",
"http://localhost:3000/photos"
]
},
"assert": {
"preset": "lighthouse:no-pwa",
"assertions": {
"canonical": "off",
"dom-size": "warn",
"link-text": "warn",
"non-composited-animations": "warn",
"preload-lcp-image": "off",
"unsized-images": "warn",
"unused-javascript": "off",
"uses-http2": "off",
"uses-responsive-images": "warn",
"uses-webp-images": "warn"
}
},
"upload": {
"target": "temporary-public-storage"
}
}
}
19 changes: 19 additions & 0 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lighthouse

on:
push:

jobs:
lighthouse:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- run: npm install serve@latest
- uses: treosh/lighthouse-ci-action@v10
with:
configPath: '.github/lighthouse.json'
uploadArtifacts: true

0 comments on commit b2b1ed0

Please sign in to comment.