Skip to content

Commit bd3fbf8

Browse files
committed
Adjust e2e workflow
1 parent 012f654 commit bd3fbf8

File tree

1 file changed

+16
-41
lines changed

1 file changed

+16
-41
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ on:
44
workflow_dispatch:
55
inputs:
66
e2e_branch:
7-
description: "Branch of synonymdev/bitkit-e2e-tests to use"
7+
description: "Branch of synonymdev/bitkit-e2e-tests to use (main | default-feature-branch | custom branch name)"
88
required: false
9-
default: "ios-preparation"
10-
# push:
11-
# branches: [master]
12-
# pull_request:
13-
# branches: [master]
9+
default: "default-feature-branch"
10+
pull_request:
1411

1512
env:
1613
TERM: xterm-256color
@@ -22,6 +19,7 @@ concurrency:
2219

2320
jobs:
2421
build:
22+
if: github.event.pull_request.draft == false
2523
runs-on: [self-hosted, macOS]
2624

2725
steps:
@@ -36,7 +34,7 @@ jobs:
3634
echo ""
3735
echo "Xcode Version:"
3836
xcodebuild -version
39-
37+
4038
- name: Setup iOS Simulator
4139
run: |
4240
# Set simulator name
@@ -113,9 +111,17 @@ jobs:
113111
name: bitkit-e2e-ios_${{ github.run_number }}
114112
path: e2e-app/
115113

114+
e2e-branch:
115+
if: github.event.pull_request.draft == false
116+
uses: synonymdev/bitkit-e2e-tests/.github/workflows/determine-e2e-branch.yml@main
117+
with:
118+
app_branch: ${{ github.head_ref || github.ref_name }}
119+
e2e_branch_input: ${{ github.event.inputs.e2e_branch || 'default-feature-branch' }}
120+
116121
e2e-tests:
122+
if: github.event.pull_request.draft == false
117123
runs-on: [self-hosted, macOS]
118-
needs: build
124+
needs: [build, e2e-branch]
119125

120126
strategy:
121127
fail-fast: false
@@ -200,40 +206,9 @@ jobs:
200206
done
201207
echo "Electrum server is ready!"
202208
203-
- name: Setup iOS Simulator
204-
run: |
205-
# Boot iOS Simulator
206-
xcrun simctl boot "iPhone 17" || true
207-
xcrun simctl bootstatus "iPhone 17" -b
208-
209-
# Install the app
210-
xcrun simctl install "iPhone 17" bitkit-e2e-tests/aut/bitkit.app
211-
212209
- name: Run E2E Tests (${{ matrix.shard.name }})
213-
run: |
214-
cd bitkit-e2e-tests
215-
216-
# Setup logging
217-
LOGDIR="./artifacts"
218-
mkdir -p "$LOGDIR"
219-
LOGFILE="$LOGDIR/simulator.log"
220-
221-
# Start simulator logging
222-
xcrun simctl spawn "iPhone 17" log stream --predicate 'process == "Bitkit"' --style compact > "$LOGFILE" &
223-
LOG_PID=$!
224-
225-
# Setup port forwarding for regtest and LND
226-
xcrun simctl spawn "iPhone 17" launchctl load -w /System/Library/LaunchDaemons/com.apple.usbmuxd.plist || true
227-
228-
# Cleanup function
229-
cleanup() {
230-
kill "$LOG_PID" 2>/dev/null || true
231-
wait "$LOG_PID" 2>/dev/null || true
232-
}
233-
trap cleanup EXIT INT TERM
234-
235-
# Pass everything through to WDIO/Mocha
236-
npm run e2e:ios -- "$@"
210+
working-directory: bitkit-e2e-tests
211+
run: ./ci_run_ios.sh --mochaOpts.grep "${{ matrix.shard.grep }}"
237212
env:
238213
RECORD_VIDEO: true
239214

0 commit comments

Comments
 (0)