From 1e3ad773d925f74bd9eed1d506010c0d8b53b428 Mon Sep 17 00:00:00 2001 From: Surma Date: Thu, 17 Oct 2019 10:32:55 +0100 Subject: [PATCH] Add Lighthouse CI script --- .travis.yml | 10 +++++++++- run_lighthouse.sh | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 run_lighthouse.sh diff --git a/.travis.yml b/.travis.yml index 00de3b3e..1dc355fc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,12 @@ +sudo: required +dist: xenial language: node_js +node_js: + - '10' +addons: + chrome: stable cache: npm -script: npm run build +script: + - npm run build + - ./run_lighthouse.sh after_success: npm run sizereport diff --git a/run_lighthouse.sh b/run_lighthouse.sh new file mode 100755 index 00000000..297e2b23 --- /dev/null +++ b/run_lighthouse.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +npx http-server -p 9000 ./dist & + +npm install -g @lhci/cli@next + +lhci collect --url=http://localhost:9000/ + +lhci assert --preset="lighthouse:recommended" + +EXIT_CODE=$? +kill $! +exit $EXIT_CODE \ No newline at end of file