Day 3: Audit websites automaticallly with Lighthouse
December 03, 2019
Google’s Lighthouse tool provides website auditing that is both built into the Chrome web browser and accessible as a Node module. With Lighthouse-CI, you can run Lighthouse in CI environments and send results to a dashboard.
Their basic example showcases hitting a live site and doing some audits and then saving the results using GitHub’s upload-artifact action to save it as an artifact of the workflow.
name: Lighthouseon: pushjobs:lighthouse:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v1- name: Audit URLs using Lighthouseuses: treosh/lighthouse-ci-action@v2with:urls: |https://treo.sh/https://treo.sh/demo- name: Save resultsuses: actions/upload-artifact@v1with:name: lighthouse-resultspath: '.lighthouseci' # This will save the Lighthouse results as .json files
As well, instead of saving as an artifact here, You could take those results and save them to any external service for later usage or use the
upload parameter of this action to authenticate and send the results to a LHCI server that can provide side-by-side changes between audits to see how things change over time.