feat(tools): add LightHouse CI to the GitHub workflows (#39353)

This commit is contained in:
Twaha Rahman 2020-08-06 14:44:53 +06:00 committed by GitHub
parent 1046e21a90
commit d10a584b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

26
.github/workflows/lighthouse-ci.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: CI
on:
workflow_dispatch:
schedule:
# run this Action every 14 days
- cron: '0 * */14 * *'
jobs:
lighthouseci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Set environment variables
run: cp sample.env .env
- name: Install all the dependencies
run: npm install && npm install -g @lhci/cli@0.4.x && cd client && npm install && cd ../
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: 3.6
- name: Seed sample data
run: npm run seed
- name: Build the production website and server
run: npm run build
- name: Run LightHouse CI
run: lhci autorun

17
lighthouserc.js Normal file
View File

@ -0,0 +1,17 @@
/**
* @file - Conifiguration for LightHouse CI. Vist the link below
* for more details ->
* https://github.com/GoogleChrome/lighthouse/blob/master/docs/configuration.md
*/
module.exports = {
ci: {
collect: {
url: ['http://localhost:8000/'],
startServerCommand: 'npm run start'
},
upload: {
target: 'temporary-public-storage'
}
}
};