|
name: E2E Tests - iOS |
|
|
|
on: |
|
workflow_call: |
|
secrets: |
|
ARGOS_TOKEN: |
|
required: true |
|
|
|
jobs: |
|
test-ios: |
|
env: |
|
APP_DIR: /tmp/app |
|
TEST_OUTPUT_DIR: /tmp/test-out |
|
SCREENSHOT_DIR: /tmp/screenshots |
|
runs-on: macos-latest |
|
steps: |
|
- uses: actions/checkout@v4 |
|
|
|
- name: Get app info |
|
id: app-info |
|
uses: ./.github/actions/e2e-get-app-info |
|
with: |
|
platform: ios |
|
|
|
- name: Cache app |
|
id: cache-app |
|
uses: actions/cache@v4 |
|
with: |
|
path: ${{ env.APP_DIR }} |
|
key: ios-app-${{ steps.app-info.outputs.app-version }}-${{ steps.app-info.outputs.app-etag }} |
|
|
|
- name: Download app |
|
shell: bash |
|
run: ./packages/native/scripts/ci-download-app.sh |
|
env: |
|
APP_URL: ${{ steps.app-info.outputs.app-url }} |
|
OUTPUT_DIR: ${{ env.APP_DIR }} |
|
if: steps.cache-app.outputs.cache-hit != 'true' |
|
|
|
- name: Setup development environment |
|
uses: ./.github/actions/e2e-setup-dev-env |
|
|
|
- uses: futureware-tech/simulator-action@v2 |
|
id: setup-ios-simulator |
|
with: |
|
model: "iPhone 16" |
|
|
|
- name: Install flashcards iOS app |
|
run: | |
|
echo "Installing app version ${{ steps.app-info.outputs.app-version }}" |
|
echo "Metadata from original HTTP request:" |
|
echo "---" |
|
cat "${{ env.APP_DIR }}/metadata.txt" |
|
echo "---" |
|
xcrun simctl install "${{steps.setup-ios-simulator.outputs.udid}}" "${{ env.APP_DIR }}/flashcards.app" |
|
|
|
- uses: dniHze/maestro-test-action@v1 |
|
|
|
- name: Start expo |
|
id: start-expo |
|
run: ./packages/native/scripts/ci-start-expo.sh ios |
|
|
|
- name: Run basic flow |
|
uses: nick-fields/retry@v3 |
|
with: |
|
max_attempts: 3 |
|
command: ./packages/native-e2e/scripts/ci-run-e2e.sh basic |
|
timeout_minutes: 5 |
|
env: |
|
TEST_OUTPUT_ROOT_DIR: ${{ env.TEST_OUTPUT_DIR }} |
|
SCREENSHOT_DIR: ${{ env.SCREENSHOT_DIR }} |
|
EXPO_OUT: ${{ steps.start-expo.outputs.EXPO_OUT }} |
|
|
|
- name: Run existing-user-and-undo flow |
|
uses: nick-fields/retry@v3 |
|
with: |
|
max_attempts: 3 |
|
command: ./packages/native-e2e/scripts/ci-run-e2e.sh existing-user-and-undo |
|
timeout_minutes: 5 |
|
env: |
|
TEST_OUTPUT_ROOT_DIR: ${{ env.TEST_OUTPUT_DIR }} |
|
SCREENSHOT_DIR: ${{ env.SCREENSHOT_DIR }} |
|
EXPO_OUT: ${{ steps.start-expo.outputs.EXPO_OUT }} |
|
|
|
- name: Run legacy flow |
|
uses: nick-fields/retry@v3 |
|
with: |
|
max_attempts: 3 |
|
command: ./packages/native-e2e/scripts/ci-run-e2e.sh legacy |
|
timeout_minutes: 5 |
|
env: |
|
TEST_OUTPUT_ROOT_DIR: ${{ env.TEST_OUTPUT_DIR }} |
|
SCREENSHOT_DIR: ${{ env.SCREENSHOT_DIR }} |
|
EXPO_OUT: ${{ steps.start-expo.outputs.EXPO_OUT }} |
|
|
|
- name: Upload maestro test results |
|
if: always() |
|
uses: actions/upload-artifact@v4 |
|
with: |
|
name: maestro-test-results-ios |
|
path: ~/.maestro/tests |
|
|
|
- name: Upload test outputs |
|
if: always() |
|
uses: actions/upload-artifact@v4 |
|
with: |
|
name: test-results-ios |
|
path: ${{ env.TEST_OUTPUT_DIR }} |
|
|
|
- name: Upload screenshots |
|
shell: bash |
|
run: pnpm exec argos upload --build-name ios "${{ env.SCREENSHOT_DIR }}" |
|
env: |
|
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }} |