summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Boerner <ich@felix-boerner.de>2023-12-31 20:24:42 +0100
committerFelix Boerner <ich@felix-boerner.de>2023-12-31 20:24:42 +0100
commit0e60ac26f3713f72ccdae36a5a1df1203cf4fa9f (patch)
tree6f6737ab3a8ff08c931966a84939de6a1b9ca4f2
parent2c2cc71a7330763f7a74ef48f50f8ea7f53c6e10 (diff)
ci: add lighthouse tests
-rw-r--r--.github/workflows/ci.yml27
-rw-r--r--lighthouserc.json7
2 files changed, 30 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 @@ name: CI
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 @@ jobs:
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
diff --git a/lighthouserc.json b/lighthouserc.json
new file mode 100644
index 0000000..13c9c25
--- /dev/null
+++ b/lighthouserc.json
@@ -0,0 +1,7 @@
+{
+ "ci": {
+ "collect": {
+ "staticDistDir": "./exampleSite/public"
+ }
+ }
+ }