# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
# Runs when a pull request is opened or updated.
# Does not build Docker image or deploy.
when:
    event: pull_request

steps:
    - name: install
      image: node:20-alpine
      commands:
          - corepack enable && corepack prepare pnpm@10.28.2 --activate
          - pnpm install --frozen-lockfile || pnpm install

    - name: lint
      image: node:20-alpine
      commands:
          - corepack enable && corepack prepare pnpm@10.28.2 --activate
          - pnpm run lint
          - pnpm run lint:css

    - name: build
      image: node:20-alpine
      commands:
          - corepack enable && corepack prepare pnpm@10.28.2 --activate
          - pnpm run build

    - name: test
      image: node:20-alpine
      commands:
          - corepack enable && corepack prepare pnpm@10.28.2 --activate
          - pnpm test
