name: CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - uses: actions/setup-node@v6
        with:
          node-version: 20
          cache: npm

      - run: npm ci

      - run: npm run typecheck
      - run: npm run lint
      - run: npm run test
      - run: npm run dep:check
      - run: npm run build

      - name: Smoke test — hello
        run: |
          OUTPUT=$(node dist/cmd/index.js hello)
          echo "$OUTPUT"
          test "$OUTPUT" = "Hello from {{projectName}}"
