Add lighthouse score check (#837)

* Add lighthouse check

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

* Fix URL

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

---------

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
Emruz Hossain 2023-11-23 15:18:52 +06:00 committed by GitHub
parent 434061ea6b
commit 93dc9dbb26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,30 @@ jobs:
run: |
npm run lint
lighthouse-check:
runs-on: ubuntu-latest
steps:
- name: Waiting for Netlify Preview
uses: kamranayub/wait-for-netlify-action@v2.1.1
id: preview
with:
site_name: "toha-ci"
max_timeout: 300
env:
NETLIFY_TOKEN: ${{secrets.NETLIFY_TOKEN}}
- name: Run Lighthouse
uses: foo-software/lighthouse-check-action@v10.0.0
id: lighthouseCheck
with:
accessToken: ${{ secrets.LIGHTHOUSE_TOKEN }}
gitHubAccessToken: ${{secrets.GITHUB_TOKEN}}
emulatedFormFactor: 'all'
prCommentEnabled: true
prCommentSaveOld: false
timeout: 5
urls: "${{ steps.preview.outputs.url }},${{ steps.preview.outputs.url }}/posts/,${{ steps.preview.outputs.url }}/posts/markdown-sample/,${{ steps.preview.outputs.url }}/posts/shortcodes/"
# Ensure that PR has desired labels
enforce-label:
runs-on: ubuntu-latest