Keep an eye on Google Lighthouse score changes directly on GitHub π‘π
Discover performance, accessability, SEO problems before they reach production
π track changes in performance, accessibility etc. directly in GitHub PR interface
π get detailed list of new failed audits
π automatically fail PRs if score is too low
π works with many different CI providers
npm install --save-dev @codechecks/lighthouse-keeper
Lighthouse Keeper is built on Codechecks βΒ new open source code review automation platform.
To use it, you need to install Codechecks GitHub App on a given repository and copy project secret to your CI environment.
- Install codechecks client and lighthouse-keeper:
npm install --save-dev @codechecks/client @codechecks/lighthouse-keeper
- Create
codechecks.yml
file in a root of your project. It serves as a central configuration for all different codechecks plugins.
checks:
- name: lighthouse-keeper
options:
buildPath: ./build
You might want to adjust the build path. To learn about all configuration options check out API
section of this document. We can dry run lighthouse-keeper
locally. Just make sure that your build
exists and run npx codechecks
.
Now we need to make sure that it runs on CI.
- Visit app.codechecks.io.
- Login with you github account and install Codechecks Github App on a desired repositories. Note: We don't have access to your code.
- Find your project on the list and copy secret.
- Add new environment variable to your CI configuration
CC_SECRET= <COPIED_SECRET>
. - Run
npx codechecks
as part of your CI pipeline after building the app. - That's it! π₯Create your first PR and let codechecks record initial baseline. With Codechecks you can track build size, visual regressions and much more! Check out other plugins at Awesome Codechecks
interface Options {
url?: string;
buildPath?: string;
minScores?: Dictionary<number>;
}
optional string
Provide URL that lighthouse will be ran against. url
OR buildPath
MUST be
provided.
optional string
Provide relative path to directory with build. It will be served using
http-server
package and lighthouse will be ran against it. url
OR buildPath
MUST be provided.
optional Dictionary of numbers
Provide minimal scores for each metric. Possible keys are:
- performance
- accessibility
- best-practices
- seo
- pwa
All contributions are welcomed. Read more in CONTRIBUTING.md
MIT @ codechecks.io
Thanks go to @andreasonny83 for his support and creating the lighthouse-ci