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 - Add lighthouse config #1201

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 65 additions & 43 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI/CD

on:
on:
push:
branches: [master]
pull_request:
Expand All @@ -26,69 +26,91 @@ jobs:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python
uses: ./.github/actions/setup-python
- name: Set up Python
uses: ./.github/actions/setup-python

- name: Set up Node
uses: ./.github/actions/setup-node
- name: Set up Node
uses: ./.github/actions/setup-node

- name: Collect static assets
run: |
npm run build
python manage.py collectstatic --noinput
- name: Collect static assets
run: |
npm run build
python manage.py collectstatic --noinput

- name: Check for missing migrations
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: settings.test
run: |
python manage.py makemigrations --dry-run --check
- name: Check for missing migrations
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: settings.test
run: |
python manage.py makemigrations --dry-run --check

- name: Run tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: settings.test
run: |
make test
- name: Run tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: settings.test
run: |
make test

- name: Report code coverage
uses: codecov/codecov-action@v1
- name: Report code coverage
uses: codecov/codecov-action@v1

lint:
name: "Lint and static checks"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python
uses: ./.github/actions/setup-python
- name: Set up Python
uses: ./.github/actions/setup-python

- name: Run linter
run: |
black --check .
- name: Run linter
run: |
black --check .

docs:
name: "Build documentation"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v1

- name: Set up Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Set up Python
uses: ./.github/actions/setup-python

- name: Set up Python
uses: ./.github/actions/setup-python
- name: Build documentation
run: make clean-docs build-docs

- name: Build documentation
run: make clean-docs build-docs
- name: Publish documentation to Github Pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build

- name: Publish documentation to Github Pages
if: ${{ github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build
lhci:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install, build
run: |
npm install
npm run build
- name: run Lighthouse CI
run: |
npm install -g @lhci/[email protected]
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
ci: {
collect: {
url: ["http://localhost:8000/"],
startServerCommand: "docker-compose up --build",
},
upload: { target: "temporary-public-storage" },
},
};
Loading