Skip to content

feat: Keploy lighthouse integration #4

feat: Keploy lighthouse integration

feat: Keploy lighthouse integration #4

Workflow file for this run

name: Lighthouse score
on:
pull_request:
branches:
- '**'
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- run: npm install -g serve
- name: Serve PR branch (port 3001)
run: |
serve . -l 3001 &
sleep 5
- name: Checkout main branch into separate folder
run: |
git fetch origin main
git worktree add main-branch origin/main
- name: Serve Main branch (port 3000)
run: |
cd main-branch
serve . -l 3000 &
cd ..
sleep 5
- name: Run Lighthouse audits
uses: treosh/lighthouse-ci-action@v12
with:
urls: |
http://localhost:3000/
http://localhost:3001/
uploadArtifacts: true
temporaryPublicStorage: true
- name: Parse reports and generate comment
run: node .github/scripts/lighthouse-report.js
- name: Comment on PR with Lighthouse scores
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body-path: lighthouse-comment.md