2020-08-06 08:51:02 +00:00
|
|
|
name: Lighthouse CI
|
2020-08-06 08:44:53 +00:00
|
|
|
on:
|
2020-08-08 18:09:03 +00:00
|
|
|
push:
|
2020-08-08 20:11:56 +00:00
|
|
|
branches:
|
|
|
|
# Treat the below branches as special case for working on workflows
|
|
|
|
- actions-**
|
2020-08-06 08:44:53 +00:00
|
|
|
schedule:
|
|
|
|
# run this Action every 14 days
|
|
|
|
- cron: '0 * */14 * *'
|
2020-08-08 18:09:03 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
2020-08-06 08:44:53 +00:00
|
|
|
jobs:
|
|
|
|
lighthouseci:
|
2020-08-08 18:09:03 +00:00
|
|
|
name: Lighthouse CI
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
services:
|
|
|
|
mongodb:
|
|
|
|
image: mongo:3.6.19
|
|
|
|
ports:
|
|
|
|
- 27017:27017
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [12.x]
|
|
|
|
|
2020-08-06 08:44:53 +00:00
|
|
|
steps:
|
2020-08-08 18:09:03 +00:00
|
|
|
- name: Checkout Source Files
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
2020-08-06 08:44:53 +00:00
|
|
|
with:
|
2020-08-08 18:09:03 +00:00
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
2020-09-24 17:51:45 +00:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
|
|
|
with:
|
|
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
|
|
${{ runner.os }}-build-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
2020-08-08 18:09:03 +00:00
|
|
|
- name: Set Environment variables
|
|
|
|
run: cp sample.env .env
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
npm install -g @lhci/cli@0.4
|
|
|
|
npm ci
|
|
|
|
npm run ensure-env
|
|
|
|
|
|
|
|
- name: Seed Database
|
2020-08-06 08:44:53 +00:00
|
|
|
run: npm run seed
|
2020-08-08 18:09:03 +00:00
|
|
|
|
|
|
|
- name: Build Packages
|
2020-08-06 08:44:53 +00:00
|
|
|
run: npm run build
|
2020-08-08 18:09:03 +00:00
|
|
|
|
|
|
|
- name: Run Lighthouse CI
|
2020-08-06 08:44:53 +00:00
|
|
|
run: lhci autorun
|