Skip to content

Commit

Permalink
ci: change lighthouse workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewarosario committed Jul 26, 2024
1 parent 21c0f0f commit 3ecfcec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .github/lighthouse/lightrouserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ci": {
"collect": {
"staticDistDir": "./dist/my-app"
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
Expand Down
26 changes: 10 additions & 16 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,15 @@ jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install dependencies
run: npm ci

- name: Build and start the project
run: npm run build && npx serve dist/my-app

- uses: actions/checkout@v2
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v7
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- run: npm ci
- run: npx nx affected -t build --parallel=3
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v12
with:
urls: http://localhost:3000
uploadArtifacts: true # save results as an action artifacts
temporaryPublicStorage: true # upload lighthouse audits to google temporary storage
configPath: '.github/lighthouse/lighthouserc.json'
uploadArtifacts: true
temporaryPublicStorage: true

0 comments on commit 3ecfcec

Please sign in to comment.