Add Lighthouse CI script
This commit is contained in:
10
.travis.yml
10
.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
|
||||
|
13
run_lighthouse.sh
Executable file
13
run_lighthouse.sh
Executable 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
|
Reference in New Issue
Block a user