Skip to content

Commit 4f8a704

Browse files
separating build and tests
1 parent 8f931e5 commit 4f8a704

1 file changed

Lines changed: 44 additions & 22 deletions

File tree

.github/workflows/e2e-ios.yml

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ concurrency:
99
cancel-in-progress: true
1010

1111
jobs:
12-
e2e-ios:
13-
name: E2E iOS Smoke
12+
build-ios:
13+
name: Build iOS App
1414
runs-on: macos-latest
15-
timeout-minutes: 60
15+
timeout-minutes: 45
1616

1717
steps:
1818
- name: Checkout
@@ -61,28 +61,16 @@ jobs:
6161
cd ios
6262
bundle exec pod install
6363
64-
- name: Cache Maestro
65-
uses: actions/cache@v4
66-
with:
67-
path: ~/.maestro
68-
key: maestro-${{ runner.os }}
69-
restore-keys: maestro-${{ runner.os }}
70-
71-
- name: Install Maestro
72-
run: |
73-
curl -Ls "https://get.maestro.mobile.dev" | bash
74-
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
75-
76-
- name: Select Xcode
77-
run: sudo xcode-select -switch /Applications/Xcode.app
78-
7964
- name: Cache Xcode build products
8065
uses: actions/cache@v4
8166
with:
8267
path: ios/build/Build/Products
8368
key: xcode-products-${{ runner.os }}-${{ hashFiles('ios/Podfile.lock', 'yarn.lock') }}
8469
restore-keys: xcode-products-${{ runner.os }}-
8570

71+
- name: Select Xcode
72+
run: sudo xcode-select -switch /Applications/Xcode.app
73+
8674
- name: Build iOS app for simulator
8775
env:
8876
SENTRY_DISABLE_AUTO_UPLOAD: true
@@ -97,16 +85,51 @@ jobs:
9785
SWIFT_ACTIVE_COMPILATION_CONDITIONS="DEBUG MAESTRO" \
9886
build
9987
88+
- name: Upload app artifact
89+
uses: actions/upload-artifact@v5
90+
with:
91+
name: ios-app-simulator
92+
path: ios/build/Build/Products/Debug-iphonesimulator/BitPayApp.app
93+
retention-days: 1
94+
95+
test-ios:
96+
name: E2E iOS Smoke
97+
needs: build-ios
98+
runs-on: macos-latest
99+
timeout-minutes: 30
100+
101+
steps:
102+
- name: Checkout
103+
uses: actions/checkout@v5
104+
105+
- name: Download app artifact
106+
uses: actions/download-artifact@v4
107+
with:
108+
name: ios-app-simulator
109+
path: BitPayApp.app
110+
111+
- name: Cache Maestro
112+
uses: actions/cache@v4
113+
with:
114+
path: ~/.maestro
115+
key: maestro-${{ runner.os }}
116+
restore-keys: maestro-${{ runner.os }}
117+
118+
- name: Install Maestro
119+
run: |
120+
curl -Ls "https://get.maestro.mobile.dev" | bash
121+
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
122+
100123
- name: Boot simulator
101124
run: |
102125
UDID=$(xcrun simctl list devices available | grep "iPhone 16" | head -1 | grep -E -o '\(([0-9A-F-]+)\)' | tr -d '()')
103126
xcrun simctl boot "$UDID"
127+
# Wait until simulator is fully booted before proceeding
128+
xcrun simctl bootstatus "$UDID" -b
104129
echo "SIMULATOR_UDID=$UDID" >> $GITHUB_ENV
105130
106131
- name: Install app on simulator
107-
run: |
108-
APP_PATH=$(find ios/build -name "*.app" | head -1)
109-
xcrun simctl install "$SIMULATOR_UDID" "$APP_PATH"
132+
run: xcrun simctl install "$SIMULATOR_UDID" BitPayApp.app
110133

111134
- name: Run Maestro smoke tests
112135
run: maestro test .maestro/flows/ --format junit --output maestro-results.xml
@@ -130,4 +153,3 @@ jobs:
130153
name: maestro-ios-screenshots
131154
path: ~/.maestro/tests/**/*.png
132155
retention-days: 7
133-

0 commit comments

Comments
 (0)