@immowelt/lighthouse-ci

[![Powered by Immowelt](https://img.shields.io/badge/powered%20by-immowelt-yellow.svg?colorB=ffb200)](https://stackshare.io/immowelt-group/) [![Build Status](https://travis-ci.org/ImmoweltGroup/lighthouse-ci.svg?branch=master)](https://travis-ci.org/Immow

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
310Jun 6, 2021Aug 30, 2018Minified + gzip package size for @immowelt/lighthouse-ci in KB

Readme

Powered by Immowelt Build Status Renovate enabled semantic-release

@immowelt/lighthouse-ci

Lighthouse quality gate cli, for report generation and customizable threshold validation depending on project quality specification.

Specifications

  • Threshold validation for lighthouse categories
  • Lighthouse report generation
  • Parallel validation and report generation of multiple domains

Usage

yarn global add @immowelt/lighthouse-ci

For more information use --help

lighthouse-ci --help

Configuration

You are able to define a config file which must be named lighthouse-ci.json. Lighthouse-ci search for this config in the current working dir where you execute lighthouse-ci. The config file must contains a threshold object, which refers the lighthouse categories with the threshold scores which musst be passed.

Also you are able to pass options down to lighthouse cli and chrome runner which need to be placed at options section for lighthouse options and chrome flags need to be placed at chromeFlags section.

NOTE: The passed threshold arguments to the cli overrides the config thresolds

Example:

{
  "chromeFlags": ["--headless"],
  "options": {
    "disableDeviceEmulation": true,
    "throttling": {
      "cpuSlowdownMultiplier": 1
    }
  },
  "threshold": {
    "performance": 80,
    "pwa": 80,
    "best-practices": 80,
    "accessibility": 80,
    "seo": 80
  }
}

Custom configuration file

You can also pass your own custom configuration file to the cli with the -c or --config option:

lighthouse-ci https://immowelt.de/ --config custom-config.json

Docker

We dockerized this package for a better usability in CI pipelines, you can use it locally like this:

docker pull immowelt/lighthouse-ci:latest
docker run -v /path/for/reports:/usr/src/app/lighthouse-ci immowelt/lighthouse-ci:latest https://immowelt.de/ -r

NOTE: If you want to get the generated reports locally, you need to mount a folder directly to container.

TODOs

  • Threshold configuration via config file
  • Create node API
  • Dockerized images for direct usage in CI pipeline
  • Unit tests are missing!

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.