name: E2E Android

on:
  push:
    paths:
      - packages/mobile/**

jobs:
  detox-android:
    timeout-minutes: 10
    runs-on: [self-hosted, macOS, ARM64, android]

    steps:
      - uses: actions/checkout@v4

      - name: Install dependencies
        run: |
          npm i
          npm run lerna bootstrap --scope @quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle

      - name: Pull binaries
        run: |
          git lfs install
          git lfs pull

      - name: Build Detox
        run: |
          cd packages/mobile
          detox build -c android.emu.debug.ci

      - name: Run basic tests
        run: |
          cd packages/mobile
          detox test starter -c android.emu.debug.ci