name: CI
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
  merge_group:
    types:
      - checks_requested

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

jobs:
  lint:
    runs-on: ubuntu-latest

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

      - name: Setup
        uses: ./.github/actions/setup


      - name: Typecheck files
        run: yarn typecheck


  build-library:
    runs-on: ubuntu-latest

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

      - name: Setup
        uses: ./.github/actions/setup

      - name: Build package
        run: yarn prepare

  build-web:
    runs-on: ubuntu-latest

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

      - name: Setup
        uses: ./.github/actions/setup

      - name: Build example for Web
        run: |
          yarn example expo export --platform web
