fix linting workflow and add lighthouse testing
This commit is contained in:
parent
5198e5ddac
commit
f0c976206e
2 changed files with 44 additions and 0 deletions
1
.github/workflows/editors-picks.yml
vendored
1
.github/workflows/editors-picks.yml
vendored
|
|
@ -104,6 +104,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
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 add public/editors-picks.json public/editors-picks-old/
|
||||||
git diff --staged --quiet && echo "No changes to commit." && exit 0
|
git diff --staged --quiet && echo "No changes to commit." && exit 0
|
||||||
git commit -m "chore: update editors picks"
|
git commit -m "chore: update editors picks"
|
||||||
|
|
|
||||||
43
.github/workflows/lighthouse.yml
vendored
Normal file
43
.github/workflows/lighthouse.yml
vendored
Normal file
|
|
@ -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/
|
||||||
Loading…
Reference in a new issue