Add Lighthouse CI script

This commit is contained in:
Surma
2019-10-17 10:32:55 +01:00
parent 4a01d0d548
commit 1e3ad773d9
2 changed files with 22 additions and 1 deletions

View File

@ -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

13
run_lighthouse.sh Executable file
View File

@ -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