diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml new file mode 100644 index 0000000000..5163436d82 --- /dev/null +++ b/.github/workflows/lighthouse-ci.yml @@ -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 diff --git a/lighthouserc.js b/lighthouserc.js new file mode 100644 index 0000000000..25fe2f5a37 --- /dev/null +++ b/lighthouserc.js @@ -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' + } + } +};