name: CI

on:
  push:
    branches-ignore:
      - 'hetzner/*'

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

jobs:
  lint-and-test:
    name: Lint app and run tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 22.x
          cache: yarn

      - run: yarn install --frozen-lockfile

      - uses: actions/cache@v4
        with:
          path: .turbo
          key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
          restore-keys: |
            turbo-${{ github.job }}-${{ github.ref_name }}-

      - run: yarn run build
      - run: yarn run check:types
      - run: yarn run lint
      - run: yarn run test
