diff --git a/.github/lighthouse/lightrouserc.json b/.github/lighthouse/lightrouserc.json new file mode 100644 index 0000000..bd1ac6f --- /dev/null +++ b/.github/lighthouse/lightrouserc.json @@ -0,0 +1,7 @@ +{ + "ci": { + "collect": { + "staticDistDir": "./dist/my-app" + } + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22dddd4..0189b5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index a93327f..09e5578 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -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