|
1 | | -name: Testing E2E iOS |
| 1 | +name: e2e-ios |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
5 | 5 | branches: |
6 | 6 | - '**' |
7 | | - paths-ignore: |
8 | | - - 'docs/**' |
9 | | - - 'website/**' |
10 | | - - '.spellcheck.dict.txt' |
11 | | - - '**/*.md' |
12 | | - |
13 | 7 | push: |
14 | 8 | branches: |
15 | 9 | - master |
16 | | - paths-ignore: |
17 | | - - 'docs/**' |
18 | | - - 'website/**' |
19 | | - - '.spellcheck.dict.txt' |
20 | | - # - '**/*.md' |
21 | 10 |
|
22 | 11 | concurrency: |
23 | 12 | group: ${{ github.workflow }}-${{ github.ref }} |
24 | 13 | cancel-in-progress: true |
25 | 14 |
|
26 | 15 | jobs: |
27 | | - ios: |
28 | | - name: iOS |
29 | | - runs-on: macos-14-arm64 |
30 | | - # TODO matrix across APIs, at least 11 and 15 (lowest to highest) |
31 | | - timeout-minutes: 60 |
32 | | - env: |
33 | | - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 16 | + e2e-ios: |
| 17 | + runs-on: macos-latest |
| 18 | + timeout-minutes: 10 |
34 | 19 | steps: |
35 | | - # Set up tool versions |
36 | | - - uses: actions/setup-node@v4 |
37 | | - with: |
38 | | - node-version: 18 |
39 | | - |
40 | | - - name: Configure JDK 1.11 |
41 | | - uses: actions/setup-java@v3 |
42 | | - with: |
43 | | - distribution: 'temurin' |
44 | | - java-version: '11' |
45 | | - |
46 | | - - uses: maxim-lobanov/setup-xcode@v1 |
47 | | - with: |
48 | | - xcode-version: 'latest-stable' |
49 | | - |
50 | | - - uses: actions/checkout@v3 |
51 | | - with: |
52 | | - fetch-depth: 50 |
53 | | - |
54 | | - # Set path variables needed for caches |
55 | | - - name: Set workflow variables |
56 | | - id: workflow-variables |
57 | | - run: | |
58 | | - echo "metro-cache=$HOME/.metro" >> $GITHUB_OUTPUT |
59 | | - echo "xcode-version=$(xcodebuild -version|tail -1|cut -f3 -d' ')" >> $GITHUB_OUTPUT |
60 | | - echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT |
61 | | -
|
62 | | - - uses: actions/cache@v3 |
63 | | - name: Yarn Cache |
64 | | - id: yarn-cache |
65 | | - with: |
66 | | - path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }} |
67 | | - key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }} |
68 | | - restore-keys: ${{ runner.os }}-yarn-v1 |
| 20 | + - name: Checkout react-native-update |
| 21 | + uses: actions/checkout@v4 |
69 | 22 |
|
70 | | - - uses: actions/cache@v3 |
71 | | - name: Detox Framework Cache |
72 | | - id: detox-cache |
| 23 | + - name: Checkout react-native-update-cli |
| 24 | + uses: actions/checkout@v4 |
73 | 25 | with: |
74 | | - path: ~/Library/Detox/ios |
75 | | - key: ${{ runner.os }}-detox-framework-cache-${{ steps.workflow-variables.outputs.xcode-version }} |
| 26 | + repository: reactnativecn/react-native-update-cli |
| 27 | + path: react-native-update-cli |
76 | 28 |
|
77 | | - # Detox is compiled during yarn install, using Xcode, set up cache first |
78 | | - - uses: hendrikmuhs/ccache-action@v1.2 |
79 | | - name: Xcode Compile Cache |
| 29 | + - name: Setup Node.js |
| 30 | + uses: actions/setup-node@v6 |
80 | 31 | with: |
81 | | - key: ${{ runner.os }}-v2 # makes a unique key w/related restore key internally |
82 | | - max-size: 1500M |
| 32 | + node-version: 20 |
83 | 33 |
|
84 | | - - name: Yarn Install |
85 | | - uses: nick-invision/retry@v2 |
| 34 | + - name: Setup Bun |
| 35 | + uses: oven-sh/setup-bun@v2 |
86 | 36 | with: |
87 | | - timeout_minutes: 10 |
88 | | - retry_wait_seconds: 60 |
89 | | - max_attempts: 3 |
90 | | - command: yarn --no-audit --prefer-offline |
| 37 | + bun-version: latest |
91 | 38 |
|
92 | | - - name: Setup Ruby |
93 | | - uses: ruby/setup-ruby@v1 |
| 39 | + - name: Setup Java |
| 40 | + uses: actions/setup-java@v4 |
94 | 41 | with: |
95 | | - ruby-version: 3 |
| 42 | + distribution: temurin |
| 43 | + java-version: '17' |
96 | 44 |
|
97 | | - - name: Update Ruby build tools |
98 | | - uses: nick-invision/retry@v2 |
| 45 | + - name: Setup Xcode |
| 46 | + uses: maxim-lobanov/setup-xcode@v1 |
99 | 47 | with: |
100 | | - timeout_minutes: 2 |
101 | | - retry_wait_seconds: 60 |
102 | | - max_attempts: 3 |
103 | | - command: gem update cocoapods xcodeproj |
| 48 | + xcode-version: latest-stable |
104 | 49 |
|
105 | | - - uses: actions/cache@v3 |
106 | | - name: Cache Pods |
107 | | - id: pods-cache |
108 | | - with: |
109 | | - path: tests/ios/Pods |
110 | | - key: ${{ runner.os }}-pods-v2-${{ hashFiles('tests/ios/Podfile.lock') }} |
111 | | - restore-keys: ${{ runner.os }}-pods-v2 |
112 | | - |
113 | | - - name: Pod Install |
114 | | - uses: nick-invision/retry@v2 |
115 | | - with: |
116 | | - timeout_minutes: 10 |
117 | | - retry_wait_seconds: 30 |
118 | | - max_attempts: 3 |
119 | | - command: yarn tests:ios:pod:install |
120 | | - |
121 | | - - name: Cache Firestore Emulator |
122 | | - uses: actions/cache@v3 |
123 | | - with: |
124 | | - path: ~/.cache/pushy/emulators |
125 | | - key: pushy-emulators-v1-${{ github.run_id }} |
126 | | - restore-keys: pushy-emulators-v1 |
127 | | - |
128 | | - - name: Start Firestore Emulator |
129 | | - run: yarn tests:emulator:start-ci |
| 50 | + - name: Install applesimutils |
| 51 | + run: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils |
130 | 52 |
|
131 | | - - name: Install brew utilities |
132 | | - uses: nick-invision/retry@v2 |
133 | | - with: |
134 | | - timeout_minutes: 5 |
135 | | - retry_wait_seconds: 60 |
136 | | - max_attempts: 3 |
137 | | - command: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils xcbeautify && applesimutils --list |
138 | | - |
139 | | - - name: Build iOS App |
140 | | - run: | |
141 | | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" |
142 | | - export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros |
143 | | - export CCACHE_FILECLONE=true |
144 | | - export CCACHE_DEPEND=true |
145 | | - export CCACHE_INODECACHE=true |
146 | | - export CCACHE_LIMIT_MULTIPLE=0.95 |
147 | | - ccache -s |
148 | | - export SKIP_BUNDLING=1 |
149 | | - export RCT_NO_LAUNCH_PACKAGER=1 |
150 | | - set -o pipefail |
151 | | - yarn build:ios-debug |
152 | | - ccache -s |
153 | | - shell: bash |
| 53 | + - name: Install testHotUpdate dependencies |
| 54 | + run: cd Example/testHotUpdate && bun install --frozen-lockfile |
154 | 55 |
|
155 | | - - name: Metro Bundler Cache |
156 | | - uses: actions/cache@v3 |
157 | | - with: |
158 | | - path: ${{ steps.workflow-variables.outputs.metro-cache }} |
159 | | - key: ${{ runner.os }}-metro-v1-${{ github.run_id }} |
160 | | - restore-keys: ${{ runner.os }}-metro-v1 |
| 56 | + - name: Install react-native-update-cli dependencies |
| 57 | + run: cd react-native-update-cli && bun install --frozen-lockfile |
161 | 58 |
|
162 | | - - name: Pre-fetch Javascript bundle |
| 59 | + - name: Rebuild Detox iOS framework cache |
163 | 60 | run: | |
164 | | - nohup yarn tests:packager:jet-ci & |
165 | | - printf 'Waiting for packager to come online' |
166 | | - until curl --output /dev/null --silent --head --fail http://localhost:8081/status; do |
167 | | - printf '.' |
168 | | - sleep 2 |
169 | | - done |
170 | | - echo "Packager is online! Preparing bundle..." |
171 | | - curl --output /dev/null --silent --head --fail "http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&inlineSourceMap=true" |
172 | | - echo "...javascript bundle ready" |
173 | | -
|
174 | | - - name: Create Simulator Log |
175 | | - # With a little delay so the detox test below has time to spawn it, missing the first part of boot is fine |
176 | | - # If you boot the simulator separately from detox, some other race fails and detox testee never sends ready to proxy |
177 | | - continue-on-error: true |
178 | | - run: nohup sh -c "sleep 30 && xcrun simctl spawn booted log stream --level debug --style compact > simulator.log 2>&1 &" |
179 | | - |
180 | | - - name: Detox Test |
181 | | - timeout-minutes: 60 |
182 | | - run: yarn test:ios-debug |
| 61 | + cd Example/testHotUpdate |
| 62 | + npx detox clean-framework-cache |
| 63 | + npx detox build-framework-cache |
| 64 | +
|
| 65 | + - name: Detox build (ios.sim.release) |
| 66 | + env: |
| 67 | + RNU_CLI_ROOT: ${{ github.workspace }}/react-native-update-cli |
| 68 | + run: cd Example/testHotUpdate && E2E_PLATFORM=ios npx detox build --configuration ios.sim.release |
| 69 | + |
| 70 | + - name: Detox test (ios.sim.release) |
| 71 | + env: |
| 72 | + RNU_CLI_ROOT: ${{ github.workspace }}/react-native-update-cli |
| 73 | + run: cd Example/testHotUpdate && E2E_PLATFORM=ios npx detox test --configuration ios.sim.release |
0 commit comments