From 0e60ac26f3713f72ccdae36a5a1df1203cf4fa9f Mon Sep 17 00:00:00 2001 From: Felix Boerner Date: Sun, 31 Dec 2023 20:24:42 +0100 Subject: ci: add lighthouse tests --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++---- lighthouserc.json | 7 +++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 lighthouserc.json 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" + } + } + } -- cgit v1.2.3