name: MobileApp Test

on:
  pull_request:
  push:
    branches-ignore:
      - 'hotfix-*'   # excludes hotfix branches
      - 'release'

jobs:
  expo-doctor:
    runs-on: ubuntu-latest
    env:
      CI_PIPELINE_ID: ${{github.run_number}}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: latest
      - run: cd MobileApp && npm install
      - name: Run Expo Doctor
        run: cd MobileApp && npx expo-doctor@latest

  expo-web-export:
    runs-on: ubuntu-latest
    env:
      CI_PIPELINE_ID: ${{github.run_number}}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: latest
      - run: cd MobileApp && npm install
      - name: Export Web Bundle
        uses: nick-fields/retry@v3
        with:
          timeout_minutes: 30
          max_attempts: 3
          command: cd MobileApp && npx expo export --platform web
