build: restore old lighthouse-ci.yml cfg

This commit is contained in:
Johannes Millan 2025-10-30 16:21:41 +01:00
parent cb4fa5d8ae
commit cab1043a46
3 changed files with 95 additions and 93 deletions

View file

@ -1,43 +1,45 @@
#name: Lighthouse CI
#on:
# pull_request:
# branches:
# - master
# - main
# workflow_dispatch:
# inputs: {}
# release:
# types: [published]
#
#jobs:
# lighthouse:
# runs-on: ubuntu-latest
# env:
# UNSPLASH_KEY: ${{ secrets.UNSPLASH_KEY }}
# UNSPLASH_CLIENT_ID: ${{ secrets.UNSPLASH_CLIENT_ID }}
# steps:
# - uses: actions/checkout@v5
#
# - uses: actions/setup-node@v5
# with:
# node-version: 20
# cache: 'npm'
#
# - name: Install dependencies
# run: npm i
#
# - run: npm run env # Generate env.generated.ts
#
# - name: Build production web app
# run: npm run buildFrontend:prodWeb
#
# - name: Run Lighthouse CI
# uses: treosh/lighthouse-ci-action@v12
# with:
# # Configure Lighthouse CI
# configPath: './tools/lighthouse/.lighthouserc.json'
# # Upload results to temporary storage
# uploadArtifacts: true
# temporaryPublicStorage: true
# # Run 3 times for consistency
# runs: 3
name: Lighthouse CI
on:
pull_request:
branches:
- master
- main
workflow_dispatch:
inputs: {}
release:
types: [published]
jobs:
lighthouse:
runs-on: ubuntu-latest
env:
UNSPLASH_KEY: ${{ secrets.UNSPLASH_KEY }}
UNSPLASH_CLIENT_ID: ${{ secrets.UNSPLASH_CLIENT_ID }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm i
- run: npm run env # Generate env.generated.ts
- name: Build production web app
run: npm run buildFrontend:prodWeb
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v12
with:
# Configure Lighthouse CI
configPath: './tools/lighthouse/.lighthouserc.json'
# Upload results to temporary storage
uploadArtifacts: true
temporaryPublicStorage: true
# Run 3 times for consistency
runs: 3
# Configure budgets
budgetPath: './tools/lighthouse/budget.json'

View file

@ -3,56 +3,7 @@
"collect": {
"staticDistDir": "./dist",
"numberOfRuns": 3,
"url": ["/browser/index.html"],
"budgets": [
{
"path": "/*",
"resourceSizes": [
{
"resourceType": "script",
"budget": 1200
},
{
"resourceType": "stylesheet",
"budget": 100
},
{
"resourceType": "image",
"budget": 300
},
{
"resourceType": "font",
"budget": 100
},
{
"resourceType": "total",
"budget": 1500
}
],
"resourceCounts": [
{
"resourceType": "script",
"budget": 100
},
{
"resourceType": "stylesheet",
"budget": 10
},
{
"resourceType": "image",
"budget": 50
},
{
"resourceType": "font",
"budget": 10
},
{
"resourceType": "total",
"budget": 150
}
]
}
]
"url": ["http://localhost/browser/index.html"]
},
"assert": {
"preset": "lighthouse:no-pwa",

View file

@ -0,0 +1,49 @@
[
{
"path": "/*",
"resourceSizes": [
{
"resourceType": "script",
"budget": 1200
},
{
"resourceType": "stylesheet",
"budget": 100
},
{
"resourceType": "image",
"budget": 300
},
{
"resourceType": "font",
"budget": 100
},
{
"resourceType": "total",
"budget": 1500
}
],
"resourceCounts": [
{
"resourceType": "script",
"budget": 120
},
{
"resourceType": "stylesheet",
"budget": 10
},
{
"resourceType": "image",
"budget": 50
},
{
"resourceType": "font",
"budget": 10
},
{
"resourceType": "total",
"budget": 150
}
]
}
]