Skip to content

Commit

Permalink
Update build and CI. Support host Ruby 2.5 to 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-epifanoff authored May 17, 2020
1 parent 35e02d3 commit 87675de
Show file tree
Hide file tree
Showing 27 changed files with 467 additions and 471 deletions.
38 changes: 19 additions & 19 deletions .ci/check_cache_and_install_gems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ if [[ -z $GEMS_INSTALLED ]]; then

rvm gemset list
gem list
gem install rest-client -v 2.0.2 --no-document
gem install listen -v 3.0.6 --no-document
gem install zip --no-document
gem install templater -v 1.0.0 --no-document
gem install rake -v 12.0.0 --no-document
gem install uuid -v 2.3.7 --no-document
gem install systemu -v 2.6.4 --no-document
gem install json -v 1.8.6 --no-document
gem install CFPropertyList -v 2.2.8 --no-document
gem install naturally -v 1.3.2 --no-document
gem install simctl -v 1.5.6 --no-document
gem install listen -v 3.0.6 --no-document
gem install rubyzip -v 1.2.2 --no-document
gem install ffi -v 1.9.24 --no-document
gem install rdoc -v 4.2.2 --no-document
gem install deep_merge -v 1.1.1 --no-document
gem install nokogiri -v 1.10.4 --no-document
gem install net-scp -v 1.2.1 --no-document
gem install net-ssh -v 4.2.0 --no-document
# gem install rest-client -v 2.0.2 --no-document
# gem install listen -v 3.0.6 --no-document
# gem install zip --no-document
# gem install templater -v 1.0.0 --no-document
# gem install rake -v 12.0.0 --no-document
# gem install uuid -v 2.3.7 --no-document
# gem install systemu -v 2.6.4 --no-document
# gem install json -v 1.8.6 --no-document
# gem install CFPropertyList -v 2.2.8 --no-document
# gem install naturally -v 1.3.2 --no-document
# gem install simctl -v 1.5.6 --no-document
# gem install listen -v 3.0.6 --no-document
# gem install rubyzip -v 1.2.2 --no-document
# gem install ffi -v 1.9.24 --no-document
# gem install rdoc -v 4.2.2 --no-document
# gem install deep_merge -v 1.1.1 --no-document
# gem install nokogiri -v 1.10.4 --no-document
# gem install net-scp -v 1.2.1 --no-document
# gem install net-ssh -v 4.2.0 --no-document
fi
9 changes: 2 additions & 7 deletions .ci/check_cache_and_install_ruby.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#!/usr/bin/env bash
set -x

RUBY_INSTALLED=$(rvm list | grep ruby-2.5.1)
RUBY_INSTALLED=$(rvm list | grep ruby-$RHO_RUBY)
echo $RUBY_INSTALLED
if [[ -z $RUBY_INSTALLED ]]; then
export HOMEBREW_NO_INSTALL_CLEANUP=1
#brew install openssl
rvm install --autolibs=disable 2.5.1
rvm install --autolibs=disable $RHO_RUBY
fi





5 changes: 5 additions & 0 deletions .ci/hosts/linux/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -x

#sudo adduser $USER libvirt
#sudo adduser $USER kvm
12 changes: 12 additions & 0 deletions .ci/modify_target_abi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env ruby

require 'yaml'

file = ARGV[0]
abis = ARGV[1].split(',')

cfg = YAML::load_file(file)

cfg['android']['abis'] = abis

File.write( file, cfg.to_yaml )
1 change: 1 addition & 0 deletions .ci/targets/android/build_artefact_for_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

set -x

$TRAVIS_BUILD_DIR/.ci/modify_target_abi.rb ./build.yml $ANDROID_ABIS
rake device:android:debug
1 change: 1 addition & 0 deletions .ci/targets/android/run_app_on_simulator.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -x

$TRAVIS_BUILD_DIR/.ci/modify_target_abi.rb build.yml $ANDROID_ABIS
rake run:android
3 changes: 3 additions & 0 deletions .ci/targets/iphone/rho_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -x
printf "\n\n\n\n\n\n\n\n\n" | rhodes-setup
2 changes: 2 additions & 0 deletions .ci/targets/rhosimulator_osx/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

#gem install rest-client --no-document
#gem install deep_merge --no-document
#gem install templater --no-document
#gem install uuid --no-document
#gem install listen --no-document
24 changes: 24 additions & 0 deletions .ci/targets/rhosimulator_osx/post_gem.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -x

#echo "Building rhosim"
#cd $TRAVIS_BUILD_DIR
#rm $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip
#rm -rf $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/*
#rake build:osx:rhosimulator
#cd $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/
#zip -r -y RhoSimulator.app.zip RhoSimulator.app
#rm -rf $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app
#cd $TRAVIS_BUILD_DIR
# > build.log

#OUT=$?

#if [ $OUT -eq 0 ];then
# echo "RhoSimulator built successfully"
#else
# echo "Error building RhoSimulator"
# cat build.log
#fi

#exit $OUT
4 changes: 2 additions & 2 deletions .ci/targets/rhosimulator_osx/pre_gem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rm -rf $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/*
rake build:osx:rhosimulator
cd $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/
zip -r -y RhoSimulator.app.zip RhoSimulator.app
rm -rf $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app
# rm -rf $TRAVIS_BUILD_DIR/platform/osx/bin/RhoSimulator/RhoSimulator.app
cd $TRAVIS_BUILD_DIR
# > build.log

Expand All @@ -38,4 +38,4 @@ else
cat build.log
fi

exit $OUT
exit $OUT
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rhobuild.yml
rhobuild.*.yml
lastbuildoptions.yml

Gemfile.lock

#platform/iphone/Info.plist
lib/commonAPI/*/*/*/generated/
lib/commonAPI/*/*/*/*/generated/
Expand Down
76 changes: 64 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
before_install:

- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/hosts/$TRAVIS_OS_NAME/before_install.sh
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/before_install.sh

install:
- ANDROID_NDK_HOME="${HOME}/android-ndk-r${NDK_NUMBER}"
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/check_cache_and_install_ruby.sh
- rvm use 2.5.1
- rvm use $RHO_RUBY
- |
if [[ -z $(rvm gemset list | grep rhodes) ]]; then
rvm gemset create rhodes;
fi
- rvm gemset use rhodes
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/check_cache_and_install_gems.sh
#- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/check_cache_and_install_gems.sh
- bundle install
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/hosts/$TRAVIS_OS_NAME/install.sh
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/install.sh

script:
- ANDROID_NDK_HOME="${HOME}/android-ndk-r${NDK_NUMBER}"
- rvm list
- rvm use 2.5.1
- rvm use $RHO_RUBY
- rvm gemset list
- rvm gemset use rhodes
- gem install bundler
- gem list

- cd $TRAVIS_BUILD_DIR
#- .ci/hosts/$TRAVIS_OS_NAME/build_rhoruby.sh #TODO
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/pre_gem.sh
- rake gem
- travis_wait 30 gem install ./rhodes-$(cat ./version).gem --no-document --ignore-dependencies -f
- $TRAVIS_BUILD_DIR/lib/build/buildgem.rb
- travis_wait 30 gem install ./rhodes-$(cat ./version).gem
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/rho_setup.sh
- .ci/install_rhoconnect-client.sh
- |
if [[ -n $RHO_TAU_EXTENSIONS ]]; then
.ci/install_rho-tau-extensions.sh;
fi
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/post_gem.sh

- cd $HOME
- rhodes app vanilla_rhodes_app
Expand Down Expand Up @@ -94,33 +98,74 @@ android:
- android-26
- android-${RHO_ANDROID_LEVEL:-19}
- addon-google_apis-google-${RHO_ANDROID_LEVEL:-19}
# - sys-img-x86-android-${RHO_ANDROID_LEVEL:-19}
- sys-img-armeabi-v7a-android-${RHO_ANDROID_LEVEL:-19}

env:
global:
- BUILD_ARTEFACTS_DIR=$HOME/build_artefacts
- S3_JOB_DIR="$TRAVIS_COMMIT"/"$TRAVIS_OS_NAME"
- S3_DEPLOY_DIR="$TRAVIS_REPO_SLUG"/"$TRAVIS_BRANCH"
- QTDIR="$HOME/Qt5.13.2/5.13.2/clang_64"
- RHO_RUBY="${RHO_RUBY:=2.7.0}"
- ANDROID_ABIS="${ANDROID_ABIS:=arm,aarch64}"

#osx_image: xcode9.1

#addons:
# apt:
# packages:
# - bridge-utils
# - libpulse0
# - libvirt-bin
# - qemu-kvm
# - virtinst
# - ubuntu-vm-builder

#addons:
# apt:
# packages:
# - bridge-utils
# - libpulse0
# - libvirt-bin
# - qemu-kvm
# - virtinst
# - ubuntu-vm-builder

matrix:
include:

#ios targets
- language: objective-c
os: osx
#osx_image: xcode11.4
env: RHO_TARGET="rhosimulator_osx" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"
env: RHO_TARGET="rhosimulator_osx" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh" RHO_RUBY="2.7.0"

- language: objective-c
os: osx
#osx_image: xcode11.4
env: RHO_TARGET="iphone" RHO_APP="auto_common_spec" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh"
env: RHO_TARGET="iphone" RHO_APP="auto_common_spec" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="2.6.5"

- language: objective-c
os: osx
#osx_image: xcode11.4
env: RHO_TARGET="iphone" RHO_APP="framework_spec" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh"
env: RHO_TARGET="iphone" RHO_APP="framework_spec" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="2.7.0"

- language: objective-c
os: osx
osx_image: xcode11.4
env: RHO_TARGET="iphone" RHO_APP="sas" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"

- language: objective-c
os: osx
osx_image: xcode11.4
env: RHO_TARGET="iphone" RHO_APP="universal_push_example" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"

- language: objective-c
os: osx
osx_image: xcode11.4
env: RHO_TARGET="iphone" RHO_APP="rhodes_fcm_test" CACHE_NAME="RVM_OSX" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"


- language: objective-c
os: osx
Expand All @@ -147,9 +192,15 @@ matrix:
osx_image: xcode11.4
env: RHO_TARGET="iphone_native_lib" RHO_APP="rhodes_lib_examples" CACHE_NAME="RVM_OSX2" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"

- language: objective-c
os: osx
osx_image: xcode11.4
env: RHO_TARGET="iphone_native_lib" RHO_APP="rhodes_lib_examples" CACHE_NAME="RVM_OSX2" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"

#linux targets
- language: c++
os: linux
env: RHO_TARGET="linux" RHO_APP="auto_common_spec" CACHE_NAME="RVM_LINUX" MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"
env: RHO_TARGET="linux" RHO_APP="auto_common_spec" CACHE_NAME="RVM_LINUX" MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh" RHO_RUBY="2.5.7"
dist: bionic
addons:
apt:
Expand All @@ -167,17 +218,18 @@ matrix:
- debhelper
- fakeroot

#android targets
- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="framework_spec" CACHE_NAME="RVM_LINUX" RHO_ANDROID_LEVEL="21" NDK_NUMBER="17c" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh"
env: RHO_TARGET="android" RHO_APP="framework_spec" CACHE_NAME="RVM_LINUX" RHO_ANDROID_LEVEL="21" NDK_NUMBER="20" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="2.5.7" ANDROID_ABIS="arm,x86"

- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="auto_common_spec" CACHE_NAME="RVM_LINUX" RHO_ANDROID_LEVEL="21" NDK_NUMBER="17c" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh"
env: RHO_TARGET="android" RHO_APP="auto_common_spec" CACHE_NAME="RVM_LINUX" RHO_ANDROID_LEVEL="21" NDK_NUMBER="20" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="2.6.5"

- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="auto_common_spec" CACHE_NAME="RVM_LINUX" RHO_ANDROID_LEVEL="21" NDK_NUMBER="20" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh"
env: RHO_TARGET="android" RHO_APP="auto_common_spec" CACHE_NAME="RVM_LINUX" RHO_ANDROID_LEVEL="21" NDK_NUMBER="20" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RUBY_VERSION="2.7.0"

- language: android
os: linux
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org' do
gemspec :name => 'rhodes'
end
Loading

0 comments on commit 87675de

Please sign in to comment.