Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Set up Lighthouse CI #11

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
37 changes: 37 additions & 0 deletions .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lighthouse CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
lhci:
runs-on: ubuntu-latest
strategy:
max-parallel: 4

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Prepare secrets
# we could use poetry run python manage.py createsecrets -o .env
# but this would require us to:
# 1. set up Python
# 2. install Poetry
# 3. install dependencies
# instead, we copy the example debug config file to save CI resources
run: cp .env.local .env

- name: Build Docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml build --parallel

- name: Run Lighthouse CI
run: |
npm install -g @lhci/cli@0.6.1
lhci autorun
12 changes: 12 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
ci: {
collect: {
url: ['http://localhost:8000/'],
startServerCommand: 'docker-compose -f docker-compose.yml -f docker-compose.prod.yml up',
startServerReadyTimeout: 60000,
},
upload: {
target: 'temporary-public-storage',
},
},
};