mirror of
https://github.com/bartvdbraak/omnidash.git
synced 2025-04-27 07:21:20 +00:00
feat: unlighthouse configuration and dependencies
This commit is contained in:
parent
5aa27c86a5
commit
ab161e0b91
5 changed files with 3034 additions and 10 deletions
14
.github/workflows/unlighthouse.yaml
vendored
14
.github/workflows/unlighthouse.yaml
vendored
|
@ -75,13 +75,17 @@ jobs:
|
|||
|
||||
- name: Install Dependencies
|
||||
run: pnpm install -g @unlighthouse/cli puppeteer
|
||||
|
||||
|
||||
- name: Run Unlighthouse
|
||||
run: |
|
||||
unlighthouse-ci \
|
||||
--site "${{ github.ref == 'refs/heads/main' && env.WEBSITE_URL || steps.vercel_preview_url.outputs.preview_url }}" \
|
||||
--reporter jsonExpanded \
|
||||
--build-static
|
||||
export SCAN_URL=${{ github.ref == 'refs/heads/main' && env.WEBSITE_URL || steps.vercel_preview_url.outputs.preview_url }}
|
||||
export AUTH_COOKIE=$(curl '$SCAN_URL/auth?/login' \
|
||||
-H 'Origin: $SCAN_URL' \
|
||||
-F "email=test_user" \
|
||||
-F "password=${{ secrets.TEST_USER_PASSWORD }}" \
|
||||
--verbose 2>&1 | awk -F'pb_auth=' '/pb_auth/{print $2;exit}' | awk -F';' '{print $1}')
|
||||
|
||||
unlighthouse-ci
|
||||
|
||||
- name: Upload report to Cloudflare pages
|
||||
uses: cloudflare/wrangler-action@v3.4.1
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,3 +8,4 @@ node_modules
|
|||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
.unlighthouse
|
|
@ -33,6 +33,7 @@
|
|||
"tailwindcss": "^3.3.6",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^5.0.0",
|
||||
"unlighthouse": "^0.10.6",
|
||||
"vite": "^5.0.3",
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
|
|
3005
pnpm-lock.yaml
3005
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
23
unlighthouse.config.ts
Normal file
23
unlighthouse.config.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { defineConfig } from 'unlighthouse'
|
||||
|
||||
export default defineConfig ({
|
||||
site: process.env.SITE_URL || 'http://localhost:5173/',
|
||||
scanner: {
|
||||
samples: 1,
|
||||
throttle: true,
|
||||
},
|
||||
cookies: [
|
||||
{
|
||||
name: 'pb_auth',
|
||||
value: process.env.AUTH_COOKIE || '',
|
||||
domain: 'localhost',
|
||||
path: '/',
|
||||
sameSite: 'Lax',
|
||||
}
|
||||
],
|
||||
ci: {
|
||||
reporter: 'jsonExpanded',
|
||||
buildStatic: true,
|
||||
budget: 65,
|
||||
},
|
||||
});
|
Loading…
Reference in a new issue