GoogleChrome / lighthouse-ci

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions
Apache License 2.0
6.41k stars 644 forks source link

Use Lighthouse CI without repo #921

Closed ggarnier closed 1 year ago

ggarnier commented 1 year ago

I'd like to run periodic checks - say 3 times a day - on some URLs, and then post them to Lighthouse CI, so I can check the performance history independent of code changes. But looks like it doesn't support this kind of usage. Each run is necessarily attached to a commit, and I can't upload 2 reports on the same commit.

Is it possible to do something like this?

ggarnier commented 1 year ago

Reading the docs, I've just found this info about build context:

you're running without a git repo, in a Jenkins environment, a CI provider we haven't documented yet, or are just running into errors, you can control the build context yourself.

Following the docs, I could made it work by setting these env vars when calling lhci upload:

LHCI_BUILD_CONTEXT__CURRENT_HASH="1" \
LHCI_BUILD_CONTEXT__COMMIT_MESSAGE="test 1" \
LHCI_BUILD_CONTEXT__AUTHOR="myself" \
LHCI_BUILD_CONTEXT__AVATAR_URL="<some valid image url>" \
LHCI_BUILD_CONTEXT__COMMIT_TIME="2023-06-30T11:00:00-03:00" \
lhci upload