-
Notifications
You must be signed in to change notification settings - Fork 18
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
Lighthouse CI #554
Lighthouse CI #554
Conversation
This will be used by the Lighthouse CI
* Prerender the EN homepage from a predefined instance * Precompress and serve brotli for realistic CDN-like score * Instead of `numberOfRuns` we use a retry strategy for faster results
It is included in the Lighthouse job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upload: | ||
outputDir: .lighthouseci/results | ||
target: filesystem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those files used somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they aren't, but the upload must go somewhere, so I just put them in an ignored-anyway folder. If you are fine with different values feel free to suggest some:
https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md#target
temporary-public-storage
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the investigation.
filesystem
is ok, but how about moving it to tmp/lighthouseci/results
and gitignore tmp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.lighthouseci
is written to anyway (see https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md#collect).
What we could do is something like:
upload:
outputDir: .lighthouseci
reportFilenamePattern: tmp
target: filesystem
This would no longer accumulate reports for local runs and even hide the (over)written dummy file from most IDEs.
But in case someone is actually interested in archived local results, this would be a blocker. Leave as is?
package.json
Outdated
@@ -8,6 +8,7 @@ | |||
"check-types": "tsc", | |||
"preview": "vite preview", | |||
"lint": "eslint --max-warnings 0 'src/**/*.ts' 'src/**/*.tsx' && knip", | |||
"lighthouse": "SCRIVITO_TENANT=d0a154d76edf2a7bd991fc658e700a1d SCRIVITO_ORIGIN=http://localhost:8080 PRERENDER_OBJ_ID=c2a0aab78be05a4e npm run prerender && precompress --include '(**).(css|html|js)' --types br dist-ssr && for run in $(seq 6); do lhci autorun && break; done", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding for run in $(seq 6); do lhci autorun && break; done
: Do I understand this correctly, that lighthouse will try up to six times to reach the target score? Isn't numberOfRuns
for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but
numberOfRuns
will always collect N runs first and find the max score afterwards. This means always N times the CI duration.numberOfRuns > 1
currently reports wrong numbers, see Second run and beyond falls back to old Chrome headless mode GoogleChrome/lighthouse-ci#1067
This reverts commit cccca78.
Allows to have a Lighthouse-like setup by running all three prerender scripts in order. For quick non-performance-related checks `prerender-precompress` is optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FEEDBACK (f7091b9)
Nice 🚀! Please see my comments.
upload: | ||
outputDir: .lighthouseci/results | ||
target: filesystem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the investigation.
filesystem
is ok, but how about moving it to tmp/lighthouseci/results
and gitignore tmp
?
### Challenges * deliver, e.g., `en.html` if there is also a directory `en`. * deliver the Brotli version if it exists ### Solution * `http-server` can't handle the directory/filename clash * `local-web-server` doesn't send the Brotli version with the straightforward `--static.extensions` option (https://github.com/lwsjs/local-web-server/wiki/How-to-serve-static-files) * Luckily we can work around this by using `--rewrite` (https://github.com/lwsjs/local-web-server/wiki/How-to-rewrite-URLs-to-local-or-remote-destinations)
Avoids: ``` npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FEEDBACK (a68fb50)
Almost there 🚀!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (5b2d689)
Awesome 🚀! Great work!
No description provided.