name: Lint and Typescript

on:
  push:
    branches: [main]
  pull_request:

jobs:
  lint_typescript:
    name: Lint and Typescript checks
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - name: Cancel previous runs
        uses: styfle/cancel-workflow-action@0.11.0
        with:
          access_token: ${{ github.token }}

      - uses: actions/checkout@v3

      - name: Set up steps
        uses: ./.github/actions/setup-steps

      - name: Run styles lint
        run: yarn lint:styles:ci

      - name: Run lint
        run: yarn lint:ci

      - name: Type checking
        run: yarn types:check
