13
13
SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
14
14
15
15
jobs :
16
+ cancel-previous-workflow :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - name : Cancel Previous Runs
20
+ uses : styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # pin@0.11.0
21
+ with :
22
+ access_token : ${{ github.token }}
23
+
16
24
device-test :
17
25
# Android emulator said to perform best with macos HAXM
18
26
runs-on : macos-latest
@@ -99,10 +107,26 @@ jobs:
99
107
else
100
108
mkdir -p DerivedData
101
109
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
102
- buildArgs=('-destination' 'platform=iOS Simulator,name=${{ matrix.device }}' 'ONLY_ACTIVE_ARCH=yes' '-sdk' 'iphonesimulator${{ matrix.runtime }}' '-derivedDataPath' $(cd "DerivedData" ; pwd -P))
110
+ buildArgs=(
111
+ '-destination' 'platform=iOS Simulator,name=${{ matrix.device }}'
112
+ 'ONLY_ACTIVE_ARCH=yes'
113
+ '-sdk' 'iphonesimulator${{ matrix.runtime }}'
114
+ '-derivedDataPath' $(cd "DerivedData" ; pwd -P)
115
+ )
103
116
echo "buildArgs = ${buildArgs[@]}"
104
- xcodebuild -workspace sample.xcworkspace -configuration Release -scheme sample "${buildArgs[@]}" build
105
- xcodebuild -project ../node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO "${buildArgs[@]}" build
117
+ xcodebuild \
118
+ -workspace sample.xcworkspace \
119
+ -configuration Release \
120
+ -scheme sample \
121
+ "${buildArgs[@]}" \
122
+ build
123
+ xcodebuild \
124
+ -project ../node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
125
+ -scheme WebDriverAgentRunner \
126
+ GCC_TREAT_WARNINGS_AS_ERRORS=0 \
127
+ COMPILER_INDEX_STORE_ENABLE=NO \
128
+ "${buildArgs[@]}" \
129
+ build
106
130
fi
107
131
108
132
- name : Start Appium Server
@@ -111,7 +135,7 @@ jobs:
111
135
112
136
# Wait until the Appium server starts.
113
137
- name : Check Appium Server
114
- uses : nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482 # pin@v2
138
+ uses : nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # pin@v2
115
139
with :
116
140
timeout_seconds : 60
117
141
max_attempts : 10
@@ -262,3 +286,115 @@ jobs:
262
286
config : ./test/perf/metrics-${{ matrix.platform }}.yml
263
287
sauce-user : ${{ secrets.SAUCE_USERNAME }}
264
288
sauce-key : ${{ secrets.SAUCE_ACCESS_KEY }}
289
+
290
+ react-native-build :
291
+ name : Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.platform }} ${{ matrix.build-type }}
292
+ runs-on : macos-latest
293
+ env :
294
+ RN_DIFF_REPOSITORY : https://github.com/react-native-community/rn-diff-purge.git
295
+ strategy :
296
+ fail-fast : false # keeps matrix running if one fails
297
+ matrix :
298
+ rn-version : ['0.64.4', '0.70.6']
299
+ rn-architecture : ['legacy']
300
+ platform : ['android', 'ios']
301
+ build-type : ['dev', 'production']
302
+ include :
303
+ - platform : ios
304
+ runtime : ' 16.0'
305
+ device : ' iPhone 14'
306
+ # exclude all rn versions lower than 0.70.0 for new architecture
307
+ exclude :
308
+ - rn-version : ' 0.64.4'
309
+ rn-architecture : ' new'
310
+ steps :
311
+ - uses : actions/checkout@v3
312
+
313
+ - uses : actions/setup-java@v3
314
+ with :
315
+ java-version : ' 11'
316
+ distribution : ' adopt'
317
+
318
+ - name : Setup JS Tools
319
+ run : yarn global add yalc semver
320
+
321
+ - name : NPM cache SDK
322
+ uses : actions/cache@v3
323
+ id : deps-cache
324
+ with :
325
+ path : node_modules
326
+ key : ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock') }}
327
+
328
+ - name : Install SDK JS Dependencies
329
+ if : steps.deps-cache.outputs['cache-hit'] != 'true'
330
+ run : yarn install
331
+
332
+ - name : Build SDK
333
+ run : yarn build
334
+
335
+ - name : Package SDK
336
+ run : yalc publish
337
+
338
+ - name : Download Plain RN ${{ matrix.rn-version }} App
339
+ working-directory : test/react-native/versions
340
+ run : git clone $RN_DIFF_REPOSITORY --branch release/${{ matrix.rn-version }} --single-branch ${{ matrix.rn-version }}
341
+
342
+ - name : Add SDK to App
343
+ working-directory : test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
344
+ run : yalc add @sentry/react-native
345
+
346
+ - name : Install App JS Dependencies
347
+ working-directory : test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
348
+ run : yarn install
349
+
350
+ - name : Install App Pods
351
+ if : matrix.platform == 'ios'
352
+ working-directory : test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios
353
+ run : |
354
+ [[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
355
+ [[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
356
+ echo "ENABLE_PROD=$ENABLE_PROD"
357
+ echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
358
+ PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH pod install
359
+
360
+ - name : Patch App RN
361
+ working-directory : test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
362
+ run : patch --verbose --strip=0 --force --ignore-whitespace --fuzz 4 < ../../../rn.patch
363
+
364
+ - name : Patch iOS App RN
365
+ if : matrix.platform == 'ios'
366
+ working-directory : test/react-native
367
+ run : |
368
+ ./rn.patch.xcode.js \
369
+ --project 'versions/${{ matrix.rn-version }}/RnDiffApp/ios/RnDiffApp.xcodeproj/project.pbxproj' \
370
+ --rn-version '${{ matrix.rn-version }}'
371
+
372
+ - name : Build Android App
373
+ if : matrix.platform == 'android'
374
+ working-directory : test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/android
375
+ run : |
376
+ if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
377
+ perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
378
+ echo 'New Architecture enabled'
379
+ fi
380
+ [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
381
+ echo "Building $CONFIG"
382
+ ./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
383
+
384
+ - name : Build iOS App
385
+ if : matrix.platform == 'ios'
386
+ working-directory : test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios
387
+ run : |
388
+ [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
389
+ echo "Building $CONFIG"
390
+ derivedData="$(cd "DerivedData" ; pwd -P)"
391
+ mkdir -p "$derivedData"
392
+ xcodebuild \
393
+ -workspace RnDiffApp.xcworkspace \
394
+ -configuration "$CONFIG" \
395
+ -scheme RnDiffApp \
396
+ -destination 'platform=iOS Simulator,name=${{ matrix.device }}' \
397
+ ONLY_ACTIVE_ARCH=yes \
398
+ -sdk 'iphonesimulator${{ matrix.runtime }}' \
399
+ -derivedDataPath "$derivedData" \
400
+ build
0 commit comments