name: Lighthouse Check
on: [pull_request]

jobs:
  lighthouse-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - run: mkdir /tmp/artifacts
      - uses: actions/setup-node@v3
        with:
          node-version: 20.x
      - name: install and build
        run: |
          yarn
          yarn build:sizecompare
      - name: run Lighthouse CI
        working-directory: ./
        run: |
          npx @lhci/cli@0.7.x autorun
        env:
          LHCI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
