Skip to content

Commit

Permalink
Update CI build script (dotintent#533)
Browse files Browse the repository at this point in the history
* Add RN 0.60.5 target
* Update SYS to 23 which contains kernel-ranchu image for Android emulator.
* Add patches to RN 0.60.5 version.
* Use npm to download react-native-ble-plx dependency (git submodule support).
* Use pod executable only on OSX and prefer to build workspace if there exists one.
* Create additional step for RN 0.60 to run jettifier on Android.
* Test only one major release with latest patch. Remove RN versions which needed gradle changes.
  • Loading branch information
Cierpliwy authored Sep 12, 2019
1 parent b8218bc commit 9d2e9dc
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 257 deletions.
92 changes: 22 additions & 70 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
- 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
Expand Down Expand Up @@ -44,15 +45,19 @@ _android_job_template: &android_job_template
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses
# Platform tools
- sdkmanager "emulator" "tools" "platform-tools" > /dev/null
- 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 -n test -k "system-images;android-$SYS;$ABI"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window $EMU_ADDITIONAL_OPTIONS ${EMU_DEBUG} &
- 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
Expand All @@ -65,7 +70,7 @@ _android_job_template: &android_job_template
- cd android
- npm start &
- sleep 5
- curl -s http://localhost:8081/index.bundle\?platform\=ios\&dev\=true\&minify\=false > /dev/null
- curl -s http://localhost:8081/index.bundle\?platform\=android\&dev\=true\&minify\=false > /dev/null
- ./gradlew connectedAndroidTest

_ios_job_template: &ios_job_template
Expand All @@ -78,12 +83,7 @@ _ios_job_template: &ios_job_template
xcode_destination: platform=iOS Simulator
# before_script will make project
script:
- cd integration-tests/Setup
- node_modules/.bin/flow check
- npm start &
- sleep 5
- curl -s http://localhost:8081/index.bundle\?platform\=ios\&dev\=true\&minify\=false > /dev/null
- xcodebuild test -scheme Setup -project ios/Setup.xcodeproj -quiet -UseModernBuildSystem=NO -destination 'platform=iOS Simulator,name=iPhone XS Max,OS=12.1'
- integration-tests/scripts/build-ios-project integration-tests/Setup

matrix:
include:
Expand All @@ -98,77 +98,29 @@ matrix:
# Integration tests for different React Native versions

- <<: *android_job_template
name: 'Integrate with RN 0.59.3 Android'
env: RN_VERSION=0.59.3
- <<: *ios_job_template
name: 'Integrate with RN 0.59.3 iOS'
env: RN_VERSION=0.59.3

- <<: *android_job_template
name: 'Integrate with RN 0.59.1 Android'
env: RN_VERSION=0.59.1
- <<: *ios_job_template
name: 'Integrate with RN 0.59.1 iOS'
env: RN_VERSION=0.59.1

- <<: *android_job_template
name: 'Integrate with RN 0.59.0 Android'
env: RN_VERSION=0.59.0
name: 'Integrate with RN 0.60.5 Android'
env: RN_VERSION=0.60.5
- <<: *ios_job_template
name: 'Integrate with RN 0.59.0 iOS'
env: RN_VERSION=0.59.0
name: 'Integrate with RN 0.60.5 iOS'
env: RN_VERSION=0.60.5

- <<: *android_job_template
name: 'Integrate with RN 0.58.3 Android'
env: RN_VERSION=0.58.3
name: 'Integrate with RN 0.59.10 Android'
env: RN_VERSION=0.59.10
- <<: *ios_job_template
name: 'Integrate with RN 0.58.3 iOS'
env: RN_VERSION=0.58.3
name: 'Integrate with RN 0.59.10 iOS'
env: RN_VERSION=0.59.10

- <<: *android_job_template
name: 'Integrate with RN 0.58.0 Android'
env: RN_VERSION=0.58.0
name: 'Integrate with RN 0.58.6 Android'
env: RN_VERSION=0.58.6
- <<: *ios_job_template
name: 'Integrate with RN 0.58.0 iOS'
env: RN_VERSION=0.58.0
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

- <<: *android_job_template
name: 'Integrate with RN 0.57.5 Android'
env: RN_VERSION=0.57.5
- <<: *ios_job_template
name: 'Integrate with RN 0.57.5 iOS'
env: RN_VERSION=0.57.5

- <<: *android_job_template
name: 'Integrate with RN 0.57.2 Android'
env: RN_VERSION=0.57.2
- <<: *ios_job_template
name: 'Integrate with RN 0.57.2 iOS'
env: RN_VERSION=0.57.2

- <<: *android_job_template
name: 'Integrate with RN 0.56.1 Android'
env: RN_VERSION=0.56.1
- <<: *ios_job_template
name: 'Integrate with RN 0.56.1 iOS'
env: RN_VERSION=0.56.1

- <<: *android_job_template
name: 'Integrate with RN 0.55.4 Android'
env: RN_VERSION=0.55.4
- <<: *ios_job_template
name: 'Integrate with RN 0.55.4 iOS'
env: RN_VERSION=0.55.4

allow_failures:
- name: 'Integrate with RN 0.55.4 Android'
- name: 'Integrate with RN 0.55.4 iOS'
- name: 'Integrate with RN 0.56.1 Android'
- name: 'Integrate with RN 0.56.1 iOS'
25 changes: 0 additions & 25 deletions integration-tests/patches/rn-0.57.2/0001-minSdkVersion-bump.patch

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions integration-tests/patches/rn-0.57.5/0001-minSdkVersion-bump.patch

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions integration-tests/patches/rn-0.58.3/0001-minSdkVersion-bump.patch

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions integration-tests/patches/rn-0.59.3/0001-minSdkVersion-bump.patch

This file was deleted.

This file was deleted.

10 changes: 10 additions & 0 deletions integration-tests/patches/rn-0.60.5/0000-npm-jetify.android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -eo pipefail

PROJECT_NAME=$1

pushd $PROJECT_NAME
npm install --save-dev jetifier
npx jetify
popd
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
diff --git a/integration-tests/Setup/android/app/build.gradle b/integration-tests/Setup/android/app/build.gradle
index 1f01fa3..207d72c 100644
index a79b79d..ae47a12 100644
--- a/integration-tests/Setup/android/app/build.gradle
+++ b/integration-tests/Setup/android/app/build.gradle
@@ -103,6 +103,7 @@ android {
@@ -133,6 +133,7 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
splits {
abi {
@@ -138,6 +139,10 @@ dependencies {
@@ -191,6 +192,10 @@ dependencies {
implementation project(':react-native-ble-plx')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
+ androidTestImplementation 'androidx.test:runner:1.1.0'
+ androidTestImplementation 'androidx.test:rules:1.1.0'
}

// Run this once to be able to run the application with BUCK
if (enableHermes) {
def hermesPath = "../../node_modules/hermesvm/android/";
14 changes: 14 additions & 0 deletions integration-tests/patches/rn-0.60.5/0003-podfile-update.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/integration-tests/Setup/ios/Podfile b/integration-tests/Setup/ios/Podfile
index 0971cc5..f754ec2 100644
--- a/integration-tests/Setup/ios/Podfile
+++ b/integration-tests/Setup/ios/Podfile
@@ -28,7 +28,8 @@ target 'Setup' do
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-ble-plx', :path => '../node_modules/react-native-ble-plx'
-
+ pod 'react-native-ble-plx-swift', :path => '../node_modules/react-native-ble-plx'
+
target 'SetupTests' do
inherit! :search_paths
# Pods for testing
Loading

0 comments on commit 9d2e9dc

Please sign in to comment.