forked from dotintent/react-native-ble-plx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
126 lines (116 loc) · 4.18 KB
/
.travis.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
stages:
- name: self-test
if: type = push
- name: integration
if: branch = master OR type = pull_request
env:
global:
- SYS=22
- ABI="default;armeabi-v7a"
- ADB_INSTALL_TIMEOUT=10 # minutes
- EMULATOR_VERSION=4969155 # ver 27.3.10.
_integration_job_template: &integration_job_template
stage: integration
cache: npm
install:
- nvm install 11
- node --version
- gem install xcodeproj
- npm install
- npm install -g yarn
- npm install -g react-native-cli
before_script:
- integration-tests/scripts/make-project $RN_VERSION integration-tests/Setup
_android_job_template: &android_job_template
<<: *integration_job_template
language: generic
dist: trusty
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
# Install android tools
- ANDROID_TOOLS=4333796 # android-28
- export ANDROID_HOME=~/android-sdk
- wget -q "https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_TOOLS.zip" -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Silence warning.
- mkdir -p ~/.android
- touch ~/.android/repositories.cfg
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses
# Platform tools
- sdkmanager "tools" "platform-tools" > /dev/null
- sdkmanager --list | head -15
# Android emulator
- wget -q "https://dl.google.com/android/repository/emulator-linux-$EMULATOR_VERSION.zip" -O emulator.zip
- unzip -q emulator.zip -d ${ANDROID_HOME}
- rm emulator.zip
# install older build tools (for emulator)
- sdkmanager "build-tools;28.0.3" "build-tools;25.0.2" "platforms;android-28" "platforms;android-25" > /dev/null
# Create and start emulator.
- sdkmanager "system-images;android-$SYS;$ABI" > /dev/null
- sdkmanager --list | head -15
- echo no | avdmanager create avd --force -n test -k "system-images;android-$SYS;$ABI"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window -no-boot-anim &
# before_script will make project
script:
- integration-tests/scripts/wait-for-emulator
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
- adb shell input keyevent 82 &
- cd integration-tests/Setup
- node_modules/.bin/flow check
- cd android
- npm start &
- sleep 5
- curl -s http://localhost:8081/index.bundle\?platform\=android\&dev\=true\&minify\=false > /dev/null
- ./gradlew connectedAndroidTest
_ios_job_template: &ios_job_template
<<: *integration_job_template
language: objective-c
os: osx
osx_image: xcode10.1
xcode_project: integration-tests/Setup/ios/Setup.xcodeproj
xcode_scheme: Setup
xcode_destination: platform=iOS Simulator
# before_script will make project
script:
- integration-tests/scripts/build-ios-project integration-tests/Setup
matrix:
include:
- language: node_js
stage: self-test
node_js: 8
script:
- npm install
- npm run lint
- npm test
# Integration tests for different React Native versions
- <<: *android_job_template
name: 'Integrate with RN 0.60.5 Android'
env: RN_VERSION=0.60.5
- <<: *ios_job_template
name: 'Integrate with RN 0.60.5 iOS'
env: RN_VERSION=0.60.5
- <<: *android_job_template
name: 'Integrate with RN 0.59.10 Android'
env: RN_VERSION=0.59.10
- <<: *ios_job_template
name: 'Integrate with RN 0.59.10 iOS'
env: RN_VERSION=0.59.10
- <<: *android_job_template
name: 'Integrate with RN 0.58.6 Android'
env: RN_VERSION=0.58.6
- <<: *ios_job_template
name: 'Integrate with RN 0.58.6 iOS'
env: RN_VERSION=0.58.6
- <<: *android_job_template
name: 'Integrate with RN 0.57.8 Android'
env: RN_VERSION=0.57.8
- <<: *ios_job_template
name: 'Integrate with RN 0.57.8 iOS'
env: RN_VERSION=0.57.8