Skip to content

Instantly share code, notes, and snippets.

@MichaelDimmitt
Last active June 26, 2022 17:34
Show Gist options
  • Save MichaelDimmitt/ba3c6dc671e6609d94c6b8bb2612e831 to your computer and use it in GitHub Desktop.
Save MichaelDimmitt/ba3c6dc671e6609d94c6b8bb2612e831 to your computer and use it in GitHub Desktop.
using lighthouse ci + lighthouse server , azure pipeline and github action translations.

Using lighthouse ci + lighthouse server, via azure pipeline and github action

How to test prod and qa links using lighthouse server.

How to monitor branch updates using lighthouse server.

potential audiences

  1. the business and seo team needing to track lighthouse performance scores.
  2. future developers wanting a professional solution to adding lighthouse to their ci.

link to a previous jbs article on what lighthouse is and how to use it: https://www.jbssolutions.com/resources/blog/lighthouse-full-stack-developer/

outcomes

lighthouse-ci

The remaining article contains a simplified implementation of the google getting started document . Refer to the google getting started document if you want to customize your solution further.

Getting lhci setup:

One file is needed for the lhci (lighthouse ci) command to work: lighthouserc.json

pro tip: Skip assertions and get the scores showing in the browser.

Our default configs will help you get started: lighthouserc.json using temp storage without lighthouse server to hit a production url:

{
	"ci": {
		"collect": {
			"numberOfRuns": 5,
			"url": [
				"https://github.com/GoogleChrome/lighthouse-ci",
			]
		},
		"upload": {
			"target": "temporary-public-storage"
		}
	}
}

a future article

useful browser tools and sites for debugging and fixing front end performance:

  1. webpagetest-filmstrip:
    https://www.webpagetest.org/video/compare.php?tests=220518_AiDcQ6_CED-r:1-c:0-e:filmstrip

future improvements

future improvements may involve a script to cleanup all runs greater than a month old. but leaving 1 per month intact for a historical record.

how to check database usage on heroku:

how to delete old runs from the heroku database:

GoogleChrome/lighthouse-ci#149 (comment)

DELETE FROM statistics WHERE buildId = '3c6285c747ffefc477b956c54e23a33b662d7986’;
DELETE FROM runs WHERE buildId = '3c6285c747ffefc477b956c54e23a33b662d7986’;
DELETE FROM builds WHERE id = '3c6285c747ffefc477b956c54e23a33b662d7986’;

other helpful links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment