name: Run Jest Unit Tests
on:
  push:
    branches-ignore:
      - "main"

jobs:
  run-jest-test-suite:
    runs-on: macos-15
    steps:
      - name: 🛒 Checkout
        uses: actions/checkout@v4

      - name: 🖥 Setup Node 20
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: 💬 Echo package.json version to Github ENV
        run: echo VERSION_NUMBER=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV

      - name: 🍎 Run yarn init-ios:new-arch
        run: yarn init-ios:new-arch
      
      - name: 🔍 Run yarn tsc
        run: yarn tsc

      - name: 🧪 Run yarn test
        run: yarn test

      - name: 🦋 Check Styling 
        run: yarn format:check