diff --git a/.github/workflows/unlighthouse.yaml b/.github/workflows/unlighthouse.yaml index d70f72e..adc0d54 100644 --- a/.github/workflows/unlighthouse.yaml +++ b/.github/workflows/unlighthouse.yaml @@ -40,15 +40,21 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: Retrieve Vercel Preview URL + uses: zentered/vercel-preview-url@v1.1.9 + id: vercel_preview_url + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + with: + vercel_project_id: ${{ vars.VERCEL_PROJECT_ID }} - - name: Build production - run: pnpm run build - - - name: Start Preview and Get Preview URL - run: | - pnpm run preview --port ${{ env.PORT }} & echo $! > preview_pid + - name: Await Vercel Deployment + uses: UnlyEd/github-action-await-vercel@v1.2.43 + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + with: + deployment-url: ${{ steps.vercel_preview_url.outputs.preview_url }} + timeout: 120 - name: Install Dependencies run: pnpm add -g @unlighthouse/cli puppeteer @@ -56,7 +62,7 @@ jobs: - name: Run Unlighthouse run: | unlighthouse-ci \ - --site "http://localhost:${{ env.PORT }}" \ + --site "${{ steps.vercel_preview_url.outputs.preview_url }}" \ --reporter jsonExpanded \ --build-static diff --git a/unlighthouse.config.ts b/unlighthouse.config.ts new file mode 100644 index 0000000..89996c7 --- /dev/null +++ b/unlighthouse.config.ts @@ -0,0 +1,8 @@ +export default { + scanner: { + samples: 3 + }, + puppeteerClusterOptions: { + maxConcurrency: 1 + } +};