From f0c976206eff21802bac97af79b730d160fea85b Mon Sep 17 00:00:00 2001 From: edideaur Date: Sun, 5 Apr 2026 19:39:41 +0000 Subject: [PATCH] fix linting workflow and add lighthouse testing --- .github/workflows/editors-picks.yml | 1 + .github/workflows/lighthouse.yml | 43 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/lighthouse.yml diff --git a/.github/workflows/editors-picks.yml b/.github/workflows/editors-picks.yml index d645fb2..680ce1a 100644 --- a/.github/workflows/editors-picks.yml +++ b/.github/workflows/editors-picks.yml @@ -104,6 +104,7 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + git pull --rebase origin main git add public/editors-picks.json public/editors-picks-old/ git diff --staged --quiet && echo "No changes to commit." && exit 0 git commit -m "chore: update editors picks" diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml new file mode 100644 index 0000000..f9fd3a2 --- /dev/null +++ b/.github/workflows/lighthouse.yml @@ -0,0 +1,43 @@ +name: Lighthouse + +on: + workflow_dispatch: + push: + branches: [main] + +jobs: + lighthouse: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Preview build + run: npm run preview & + continue-on-error: true + + - name: Wait for preview server + run: sleep 10 + + - name: Run Lighthouse + run: | + npx lhci autorun --config=.lhci.yml || true + + - name: Upload results + if: always() + uses: actions/upload-artifact@v4 + with: + name: lighthouse-results + path: .lighthouseci/