-
Notifications
You must be signed in to change notification settings - Fork 8
135 lines (108 loc) · 3.82 KB
/
ci-detox-ios.yml
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
name: ci-detox-ios
on:
pull_request:
branches:
- master
jobs:
libraries:
name: Build Wrapper Libraries
runs-on: macos-14
defaults:
run:
working-directory: ./wrappers/react-native
steps:
- name: Checkout
uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # [email protected]
- name: Setup rust toolchain
uses: actions-rs/toolchain@b2417cde72dcf67f306c0ae8e0828a81bf0b189f # [email protected]
with:
profile: minimal
toolchain: 1.70.0
override: true
- name: Print versions
run: |
rustc --version
xcodebuild -version
- name: List Installed Xcode Versions
run: ls /Applications | grep Xcode
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
- name: Verify Xcode Version
run: xcodebuild -version
- name: Build Libraries for iOS
run: yarn build:ios
- name: Archive build artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: ci-detox-ios-artifacts-libs-${{ github.sha }}
path: wrappers/react-native/ios/lib
retention-days: 1
ios:
name: Detox iOS E2E Testing
needs: [libraries]
runs-on: macos-latest
# strategy:
# matrix:
# runners: [[self-hosted, macos, general, detox-ios]]
# concurrency:
# group: ci-detox-ios-${{ matrix.runners }}-${{ github.head_ref || github.run_id }}
# cancel-in-progress: true
timeout-minutes: 120
defaults:
run:
working-directory: wrappers/react-native
shell: zsh -il {0} # load ~/.zshrc
env:
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer
NODE_OPTIONS: "--max-old-space-size=5120"
# Do not launch packager during CI build
RCT_NO_LAUNCH_PACKAGER: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
- name: Download iOS Libraries
uses: actions/download-artifact@v3
with:
name: ci-detox-ios-artifacts-libs-${{ github.sha }}
path: wrappers/react-native/ios/lib
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
- name: Inspect iOS Libraries
run: ls -R ios/lib
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Example App Install Dependencies
run: yarn example --frozen-lockfile
- name: Example App Install Pods
run: yarn example pods
- run: brew tap wix/brew
- run: brew install applesimutils
- name: Print Simulators
run: applesimutils --list
# - name: Install iPhone 11 Simulator
# run: |
# xcrun simctl create "iPhone 11" com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-17-0
- name: Setup iOS Simulator
uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9 #pin @v3
with:
model: "iPhone 11"
os_version: =17.0 # https://github.com/futureware-tech/simulator-action/wiki
shutdown_after_job: true
erase_before_boot: true # change to true for temporary fix when some of the tests are failing
- name: Detox Build iOS Configuration
run: yarn detox:build:ios
- name: Detox E2E Test
run: yarn detox:ios:ci
- name: Archive detox failed test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: detox-artifacts-${{ github.sha }}
path: wrappers/react-native/example/detox-artifacts
retention-days: 1