Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakejarvis/lighthouse-action
๐ก๐ GitHub Action for running @GoogleChromeLabs Lighthouse webpage audits
https://github.com/jakejarvis/lighthouse-action
accessibility actions chrome ci github-actions lighthouse pwa seo
Last synced: 9 days ago
JSON representation
๐ก๐ GitHub Action for running @GoogleChromeLabs Lighthouse webpage audits
- Host: GitHub
- URL: https://github.com/jakejarvis/lighthouse-action
- Owner: jakejarvis
- License: mit
- Created: 2019-08-22T18:25:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-11T20:10:04.000Z (almost 4 years ago)
- Last Synced: 2024-10-21T00:41:43.803Z (19 days ago)
- Topics: accessibility, actions, chrome, ci, github-actions, lighthouse, pwa, seo
- Language: Shell
- Homepage: https://github.com/marketplace/actions/lighthouse-audit
- Size: 994 KB
- Stars: 343
- Watchers: 9
- Forks: 29
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-actions - Audit a webpage with Google Chrome's Lighthouse tests
- fucking-awesome-actions - Audit a webpage with Google Chrome's Lighthouse tests
- awesome-workflows - Audit a webpage with Google Chrome's Lighthouse tests
README
# GitHub Action for [Lighthouse Auditing](https://developers.google.com/web/tools/lighthouse/)
This action integrates Google's helpful [Lighthouse audits](https://developers.google.com/web/tools/lighthouse/) for webpages โย specifically testing for Performance, Accessibility, Best Practices, SEO, and Progressive Web Apps. Right now, the action will print the five scores (out of 100) to the output and upload HTML and JSON versions of the report as artifacts. In the next release, the action will let you specify thresholds for each test and optionally fail this step if they are not met.
Inspired by [GoogleChromeLabs/lighthousebot](https://github.com/GoogleChromeLabs/lighthousebot).
## Usage
### `workflow.yml` Example
The following workflow runs a Lighthouse audit on [https://jarv.is/](https://jarv.is/), shows the five scores in the output of the step, and uploads the `.html` and `.json` results as artifacts to download (as shown above).
```yaml
name: Audit live site
on: pushjobs:
audit:
runs-on: ubuntu-latest
steps:
- name: Audit live URL
uses: jakejarvis/lighthouse-action@master
with:
url: 'https://jarv.is/'
- name: Upload results as an artifact
uses: actions/upload-artifact@master
with:
name: report
path: './report'
```### Pull Request Audits with [Netlify Deploy Preview](https://www.netlify.com/docs/continuous-deployment/)
This GitHub action integrates with [Netlify's Deploy Preview](https://www.netlify.com/docs/continuous-deployment/) feature, allowing you to test PRs before accepting them. To enable, you need to pass in your Netlify site's URL (on the Netlify subdomain โย also called your "site name" in the Netlify dashboard โ **not your custom domain**) to the `netlify_site` input variable:
```yaml
name: Audit pull request
on: pull_requestjobs:
audit:
runs-on: ubuntu-latest
steps:
- name: Audit Netlify deploy preview
uses: jakejarvis/lighthouse-action@master
with:
netlify_site: 'blissful-heisenberg-16c40f.netlify.com'
- uses: actions/upload-artifact@master
with:
name: report
path: './report'
```On pull requests, the PR number will be extracted from the GitHub event data and used to generate the deploy preview URL as follows: `https://deploy-preview-[[PR_NUMBER]]--[[NETLIFY_SITE]].netlify.com`. You can combine the two above examples and include both `url` and `netlify_site` and run on `on: [push, pull_request]` and the appropriate URL will be automatically selected depending on the type of event.
## To-Do
- **Make CI fail if scores do not meet specified thresholds.**
- Ability to customize flags passed to both Chrome and Lighthouse
- Batch URL testing## License
This project is distributed under the [MIT license](LICENSE.md).
License information for bundled third party software can be found in [THIRD_PARTY_NOTICE.md](THIRD_PARTY_NOTICE.md).