-
Notifications
You must be signed in to change notification settings - Fork 69
140 lines (117 loc) · 4.06 KB
/
Copy pathe2e-ios.yml
File metadata and controls
140 lines (117 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: E2E iOS
on:
workflow_dispatch:
concurrency:
group: e2e-ios-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-ios:
name: E2E iOS Smoke
runs-on: macos-latest-xlarge
timeout-minutes: 75
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Generate DKLS vendor files
run: node ./scripts/generate-dkls-vendor.js
- name: Create env file
env:
ENV_FILE: ${{ secrets.ENV_DEVELOPMENT }}
run: |
echo "$ENV_FILE" > .env.development
echo "IS_MAESTRO=true" >> .env.development
- name: Create Sentry properties
run: |
echo "${{ secrets.SENTRY_PROPERTIES }}" > sentry.properties
echo "${{ secrets.SENTRY_PROPERTIES }}" > ios/sentry.properties
echo "${{ secrets.SENTRY_PROPERTIES }}" > android/sentry.properties
- name: Set native config values
run: yarn set:dev
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.6'
bundler-cache: true
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
- name: Clean Xcode caches
run: |
rm -rf ios/build
rm -rf ~/Library/Developer/Xcode/DerivedData || true
- name: Install CocoaPods
run: cd ios && bundle exec pod install
- name: Build iOS app for simulator
env:
CI: "1"
SENTRY_DISABLE_AUTO_UPLOAD: true
NODE_OPTIONS: "--max_old_space_size=8192"
run: |
export NODE_BINARY=$(which node)
export PATH="$(dirname "$NODE_BINARY"):$PATH"
xcodebuild \
-workspace ios/BitPayApp.xcworkspace \
-scheme BitPayApp \
-configuration Debug \
-sdk iphonesimulator \
-derivedDataPath ios/build \
-destination 'generic/platform=iOS Simulator' \
NODE_BINARY="$NODE_BINARY" \
SWIFT_ACTIVE_COMPILATION_CONDITIONS="DEBUG MAESTRO" \
FORCE_BUNDLING=YES \
ONLY_ACTIVE_ARCH=YES \
ARCHS=arm64 \
build
- name: Cache Maestro
uses: actions/cache@v4
with:
path: ~/.maestro
key: maestro-${{ runner.os }}
restore-keys: maestro-${{ runner.os }}
- name: Install Maestro
run: |
curl -Ls "https://get.maestro.mobile.dev" | bash
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Boot simulator
run: |
UDID=$(xcrun simctl list devices available | grep -E "iPhone [0-9]" | head -1 | grep -E -o '\(([0-9A-F-]+)\)' | tr -d '()')
echo "Booting simulator: $UDID"
xcrun simctl boot "$UDID"
xcrun simctl bootstatus "$UDID" -b
echo "SIMULATOR_UDID=$UDID" >> $GITHUB_ENV
- name: Install app on simulator
run: xcrun simctl install "$SIMULATOR_UDID" ios/build/Build/Products/Debug-iphonesimulator/BitPayApp.app
- name: Run Maestro smoke tests
run: maestro test .maestro/flows/ --format junit --output maestro-results.xml
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 600000
- name: Upload test results
if: always()
uses: actions/upload-artifact@v5
with:
name: maestro-ios-results
path: |
maestro-results.xml
~/.maestro/tests/
retention-days: 7
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v5
with:
name: maestro-ios-screenshots
path: |
~/.maestro/tests/**/*.png
./*.png
retention-days: 7