-
Notifications
You must be signed in to change notification settings - Fork 1.5k
70 lines (67 loc) · 2.53 KB
/
react-native-code-push-ci.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
name: React-native-code-push CI
on:
pull_request:
branches:
- master
jobs:
test-android:
name: Test Android app
runs-on: macOS-12
strategy:
matrix:
api-level: [ 27 ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Start adb server
run: adb devices
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: Download system image "android-${{ matrix.api-level }}"
run: $ANDROID_HOME/tools/bin/sdkmanager "system-images;android-${{ matrix.api-level }};google_apis;x86"
- name: Create android emulator
run: $ANDROID_HOME/tools/bin/avdmanager create avd --force --name TestEmulator --abi google_apis/x86 --package 'system-images;android-${{ matrix.api-level }};google_apis;x86' --device "Nexus 6P"
- name: Start android emulator
run: $ANDROID_HOME/emulator/emulator -avd TestEmulator -noaudio -no-window -no-snapshot-save -no-boot-anim -memory 6144 &
- name: Wait for emulator to boot
run: $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done'
- run: adb shell settings put global window_animation_scale 0.0
- run: adb shell settings put global transition_animation_scale 0.0
- run: adb shell settings put global animator_duration_scale 0.0
- name: Setup Java for Android build
uses: actions/setup-java@v3
with:
distribution: microsoft
java-version: '11'
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.6'
bundler-cache: true
- name: Package Installation
run: npm install
- name: Setup Android tests
run: npm run build:tests && npm run test:setup:android
- name: Run Android test
run: mocha --recursive bin/test -g "window.codePush.sync.2x.checkerror" --android
test-iOS:
name: Test iOS app
runs-on: macOS-12
env:
NO_FLIPPER: ${{ secrets.NO_FLIPPER }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.6'
bundler-cache: true
- name: (Workaround) Install activesupport 7.0.8
run: gem install activesupport -v 7.0.8
- name: Install dependencies
run: npm install
- name: Setup iOS tests
run: npm run build:tests && npm run test:setup:ios
- name: Run tests
run: npm run test:fast:ios