From bd92e749ee3350c77cbba795682b1c334d1dd570 Mon Sep 17 00:00:00 2001 From: Restioson Date: Fri, 18 Oct 2024 15:55:16 +0200 Subject: [PATCH] chore(ci): set up Lighthouse auditing in CI For now, this just hits the main pages --- .github/workflows/testing.yml | 8 ++++++++ .gitignore | 3 +++ app/lighthouserc.json | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 app/lighthouserc.json diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 24ebbca1..e04c6c57 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -16,11 +16,15 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 - name: Install Dependencies run: | python -m pip install --upgrade pip pip install -r requirements-test.txt sudo apt-get install -y gettext + npm install -g @lhci/cli@0.14.x - name: Run linting tools run: | cd app/ @@ -55,3 +59,7 @@ jobs: run: | cd app/ python manage.py check + - name: Run Lighthouse + run: | + cd app/ + lhci autorun diff --git a/.gitignore b/.gitignore index 168936e7..cfb3489d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ app/media/ /logging/ /pdf_uploads/ /pdf_upload_completed/ + +# Generated Lighthouse CI artifacts +.lighthouseci/ diff --git a/app/lighthouserc.json b/app/lighthouserc.json new file mode 100644 index 00000000..7b6de377 --- /dev/null +++ b/app/lighthouserc.json @@ -0,0 +1,18 @@ +{ + "scripts": { + "serve:lhci": "python manage.py runserver localhost:3000" + }, + "ci": { + "collect": { + "url": [ + "http://localhost:3000", + "http://localhost:3000/search/", + "http://localhost:3000/institutions/", + "http://localhost:3000/projects/", + "http://localhost:3000/documents/", + "http://localhost:3000/languages/", + "http://localhost:3000/subjects/" + ] + } + } +}