Skip to content

Commit

Permalink
feat(project): lighthouse actions triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Jul 12, 2023
1 parent 6f227cf commit 0d004eb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/firebase-preview.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Firebase Preview'
name: Firebase Preview

on:
pull_request:
Expand All @@ -14,9 +14,13 @@ jobs:
APP_PLAYER_LICENSE_KEY: ${{ secrets.PLAYER_LICENSE_KEY }}
run: yarn && MODE=preview yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
id: firebase_hosting_preview
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
- name: Export url
run: echo urls ${{steps.firebase_hosting_preview.outputs.url}}
- name: Dispatch init event to run Lighthouse
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
gh workflow run 'Lighthouse' --ref '${{ github.event.pull_request.head.ref }}' -f url='${{ steps.firebase_hosting_preview.outputs.details_url }}'
20 changes: 9 additions & 11 deletions .github/workflows/lhci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Lighthouse

on:
workflow_run:
workflows: ['Firebase Preview']
types:
- completed
workflow_dispatch:
inputs:
url:
description: 'Fill preview link'

jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- name: install Lighthouse CI
run: |
sudo yarn global add @lhci/cli@0.12.x http-server
- name: run Lighthouse CI
with:
LHCI_SERVER_BASE_URL: '${{ github.event.client_payload.url }}'
run: lhci autorun
- uses: actions/checkout@v1
- name: Install Lighthouse CI
run: sudo yarn global add @lhci/cli@0.12.x http-server
- name: Run Lighthouse CI
run: lhci autorun --collect.url=${{ github.event.inputs.url }}?app-config=gnnuzabk --config=./lighthouserc.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ yarn-error.log
.firebase
firebase-debug.log
.stylelintcache
.lighthouseci

# os or editor
.idea
Expand Down
9 changes: 3 additions & 6 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
module.exports = {
ci: {
// collect: {
// url: ['http://127.0.0.1:4000'],
// startServerCommand: 'http-server ./build/public -p 4000 -g',
// startServerReadyPattern: 'Available on',
// numberOfRuns: 1,
// },
collect: {
numberOfRuns: 3,
},
upload: {
target: 'temporary-public-storage',
},
Expand Down

0 comments on commit 0d004eb

Please sign in to comment.