diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5061bf13..aac439ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,20 @@ jobs: - uses: marshallku/actions/setup-pnpm@master - name: Build apps and packages run: pnpm build + lighthouse: + name: Lighthouse CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: marshallku/actions/setup-pnpm@master + - name: Run Lighthouse CI + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} + run: | + cd apps/blog + pnpm build + pnpm add -G @lhci/cli + lhci autorun send-notification: needs: [check-spelling, lint-all, build-all] if: ${{ failure() }} diff --git a/apps/blog/lighthouserc.json b/apps/blog/lighthouserc.json new file mode 100644 index 00000000..3e0bf133 --- /dev/null +++ b/apps/blog/lighthouserc.json @@ -0,0 +1,23 @@ +{ + "ci": { + "collect": { + "startServerCommand": "pnpm start --filter @marshallku/blog", + "startServerReadyPattern": "ready on", + "url": ["http://localhost:3000"], + "numberOfRuns": 5, + "settings": { + "preset": "desktop" + } + }, + "assert": { + "preset": "lighthouse:recommended", + "assertions": { + "categories:performance": ["warn", { "minScore": 0.95 }], + "categories:accessibility": ["error", { "minScore": 0.9 }] + } + }, + "upload": { + "target": "temporary-public-storage" + } + } +}