name: Standard

on:
  pull_request:
  push:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  main:
    name: Standard
    timeout-minutes: 5
    runs-on: ubuntu-latest

    steps:
      - # https://github.com/actions/checkout
        name: Checkout
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - # https://github.com/pnpm/action-setup
        name: Install pnpm
        uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
        with:
          run_install: false

      - # https://github.com/actions/setup-node
        name: Install Node.js
        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
        with:
          node-version-file: package.json
          cache: pnpm

      - name: Install dependencies
        run: pnpm install --frozen-lockfile

      - name: Biome
        run: pnpm run tidy:check

      - name: Typescript
        run: pnpm run tsc

      - name: Knip
        run: pnpm run knip

      - name: Vitest
        run: pnpm run test
