From 0e60ac26f3713f72ccdae36a5a1df1203cf4fa9f Mon Sep 17 00:00:00 2001
From: Felix Boerner <ich@felix-boerner.de>
Date: Sun, 31 Dec 2023 19:24:42 +0000
Subject: [PATCH] ci: add lighthouse tests

---
 .github/workflows/ci.yml |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b0fec5b..c766789 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,12 +7,12 @@
     branches:
       - master
 jobs:
-  ci:
+  build:
     name: Build Hugo example site and archive output
     runs-on: ubuntu-latest
     steps:
       - name: Check out repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
 
       - name: Setup Hugo
         uses: peaceiris/actions-hugo@v2
@@ -22,8 +22,27 @@
           cd exampleSite
           hugo --verbose --baseURL= --themesDir=../../
 
-      - name: Archive Hugo example site
-        uses: actions/upload-artifact@v2
+      - name: Upload Hugo example site
+        uses: actions/upload-artifact@v4
         with:
           name: hugo-example-site
           path: exampleSite/public
+
+  lighthouse:
+    name: Run Lighthouse tests against built Hugo example site
+    runs-on: ubuntu-latest
+    needs: build
+    steps:
+      - name: Check out repository
+        uses: actions/checkout@v4
+
+      - name: Download Hugo example site
+        uses: actions/download-artifact@v4
+        with:
+          name: hugo-example-site
+          path: exampleSite/public
+
+      - name: Run Lighthouse against a static dist dir
+        uses: treosh/lighthouse-ci-action@v10
+        with:
+          configPath: ./lighthouserc.json

--
Gitblit v1.10.0