Skip to content

Instantly share code, notes, and snippets.

@pokey
Last active September 2, 2025 10:23
Show Gist options
  • Select an option

  • Save pokey/d3ac7753e692e0f255f19ef67b6e4275 to your computer and use it in GitHub Desktop.

Select an option

Save pokey/d3ac7753e692e0f255f19ef67b6e4275 to your computer and use it in GitHub Desktop.
GitHub Actions iOS E2E Test Workflow with Local Dependencies - Contains the main e2e-ios.yml workflow file and its two local action dependencies: e2e-get-app-info and e2e-setup-dev-env

GitHub Actions iOS E2E Test Workflow

This gist contains the complete GitHub Actions workflow for iOS E2E testing and its local dependency actions.

Files included:

  1. e2e-ios.yml - Main workflow file that runs iOS E2E tests
  2. e2e-setup-dev-env-action.yml - Local action that sets up the development environment with Node.js, pnpm, and Java

Workflow Overview:

The iOS E2E workflow:

  • Gets app information and caches the app build
  • Sets up iOS simulator and development environment
  • Installs the flashcards iOS app
  • Runs three test flows: basic, existing-user-and-undo, and legacy
  • Uploads test results and screenshots to Argos

Local Actions:

e2e-setup-dev-env

  • Sets up Bun, pnpm, and Node.js
  • Installs dependencies and builds the project
  • Caches Firebase emulators
  • Sets up Java 17

Both actions handle different runner environments (standard actions vs buildjet).

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 }}
name: Setup Development Environment
description: "Sets up the development environment with Node.js, pnpm, and Java"
runs:
using: "composite"
steps:
- uses: oven-sh/setup-bun@v2
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js (actions)
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
if: ${{ !startsWith(runner.name, 'buildjet') }}
- name: Set up Node.js (buildjet)
uses: buildjet/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
if: ${{ startsWith(runner.name, 'buildjet') }}
- name: Install dependencies
shell: bash
run: pnpm --color install
- name: Compile TypeScript
shell: bash
run: pnpm --color compile
- name: Build
shell: bash
run: pnpm --color build
- name: Cache firebase emulators (actions)
uses: actions/cache@v4
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-firebase-emulators
if: ${{ !startsWith(runner.name, 'buildjet') }}
- name: Cache firebase emulators (buildjet)
uses: buildjet/cache@v4
with:
path: ~/.cache/firebase/emulators
key: ${{ runner.os }}-firebase-emulators
if: ${{ startsWith(runner.name, 'buildjet') }}
- name: Set up Java (actions)
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "17"
if: ${{ !startsWith(runner.name, 'buildjet') }}
- name: Set up Java (buildjet)
uses: buildjet/setup-java@v4
with:
distribution: "adopt"
java-version: "17"
if: ${{ startsWith(runner.name, 'buildjet') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment