Skip to content

Commit

Permalink
feat(project): lighthouse check
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Jul 12, 2023
1 parent 2274c9b commit e5be802
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/firebase-live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
run: yarn && MODE=demo yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
channelId: live
8 changes: 5 additions & 3 deletions .github/workflows/firebase-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Firebase Preview'

on:
pull_request:
branches: [ 'develop', 'feat/*', 'feature/*' ]
branches: ['develop', 'feat/*', 'feature/*']

jobs:
build_and_preview:
Expand All @@ -15,6 +15,8 @@ jobs:
run: yarn && MODE=preview yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}'
expires: 30d
- name: Export url
run: echo urls ${{steps.firebase_hosting_preview.outputs.url}}
24 changes: 11 additions & 13 deletions .github/workflows/lhci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
name: Lighthouse
on: [workflow_dispatch]

on:
workflow_run:
workflows: ['Firebase Preview']
types:
- completed

jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: yarn install, build
run: |
yarn install
yarn run build
- name: install Lighthouse CI
run: |
sudo yarn global add @lhci/cli@0.7.x http-server
sudo yarn global add @lhci/cli@0.12.x http-server
- name: run Lighthouse CI
run: |
lhci autorun
with:
LHCI_SERVER_BASE_URL: '${{ github.event.client_payload.url }}'
run: lhci autorun
20 changes: 13 additions & 7 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
module.exports = {
ci: {
collect: {
url: ['http://127.0.0.1:4000'],
startServerCommand: 'http-server ./build -p 4000 -g',
startServerReadyPattern: 'Available on',
numberOfRuns: 1,
},
// collect: {
// url: ['http://127.0.0.1:4000'],
// startServerCommand: 'http-server ./build/public -p 4000 -g',
// startServerReadyPattern: 'Available on',
// numberOfRuns: 1,
// },
upload: {
target: 'temporary-public-storage',
},
assert: {
preset: 'lighthouse:no-pwa',
assertions: {
'categories:performance': ['warn', { minScore: 0.9 }],
'categories:seo': ['error', { minScore: 0.9 }],
'categories:accessibility': ['warn', { minScore: 0.9 }],
'categories:best-practices': ['warn', { minScore: 0.9 }],
'categories:pwa': ['warn', { minScore: 0.9 }],
},
},
},
};
2 changes: 1 addition & 1 deletion public/locales/en/demo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"app_config_not_found": "Invalid or Missing App Config",
"app_config_learn_more": "Learn more about the App Config creation",
"app_config_learn_more": "Learn more about App Configs",
"cancel_config_id": "Cancel",
"click_to_unselect_config": "(click here to unselect this config)",
"currently_previewing_config": "You are currently previewing config: '{{configSource}}'",
Expand Down

0 comments on commit e5be802

Please sign in to comment.