forked from rhomobile/rhodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
267 lines (221 loc) · 9.09 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
before_install:
#run target-specific and host-specific berfore_install scripts
- $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:
#install Ruby version specified in RHO_RUBY env var ( system Ruby by default )
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/check_cache_and_install_ruby.sh
- rvm use $RHO_RUBY
# run target-specific and host-specific install scripts ( for instance download and install NDK/SDK for Android targets)
- $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:
# start building of Rhodes gem in a separate gemset
- cd $TRAVIS_BUILD_DIR
#- rvm gemset create rho_build_gem
#- rvm gemset use rho_build_gem
- rvm gemset create rhodes
- rvm gemset use rhodes
- bundle install
- gem list
#TODO: build RhoRuby executable for host platform
#- .ci/hosts/$TRAVIS_OS_NAME/build_rhoruby.sh
# run target-specific and host-specific script before start of Rhodes gem build
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/hosts/$TRAVIS_OS_NAME/pre_gem.sh || travis_terminate 1
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/pre_gem.sh || travis_terminate 1
# build Rhodes gem
- $TRAVIS_BUILD_DIR/lib/build/buildgem.rb
# switch to clean gemset to run main tests in a separate environment
#- rvm gemset create rhodes
#- rvm gemset use rhodes
# install Rhodes gem to clean gemset. All dependencies should be installed automatically
- travis_wait 45 gem install --no-document ./rhodes-$(cat ./version).gem
# check rhodes path is valid
- |
if [ "$(get-rhodes-info --rhodes-path)" != "$HOME/.rvm/gems/$RHO_RUBY@rhodes/gems/rhodes-$(cat ./version)" ]
then
echo "Unexpected path to Rhodes:"
echo "$(get-rhodes-info --rhodes-path)"
echo "Expected path:"
echo "$HOME/.rvm/gems/$RHO_RUBY@rhodes/gems/rhodes-$(cat ./version)"
travis_terminate 1
fi
# run target-specific rhodes-setup command
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/rho_setup.sh
# clone and install rhoconnect-client gem
- .ci/install_rhoconnect-client.sh
# clone and install rhoconnect-client gem if required by matrix config
- |
if [[ -n $RHO_TAU_EXTENSIONS ]]; then
.ci/install_rho-tau-extensions.sh;
fi
# run target-specific script after all Rhodes build environment has been setup
- $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/post_gem.sh || travis_terminate 1
- gem list
- cd $HOME
# generate few apps from scratch
- rhodes app vanilla_rhodes_app
- cd vanilla_rhodes_app
#- safe_run_target_script upgrade_package.sh here we build not only android aps
- rhodes extension testext
- cd ..
- rhodes jsapp vanilla_rhodes_jsapp
- rhodes nodejsapp vanilla_rhodes_nodejsapp
# clone testable app if required by matrix config
- |
if [[ -n $RHO_APP ]]; then
git clone $($TRAVIS_BUILD_DIR/.ci/app_repo.rb) $HOME/$RHO_APP;
cd $HOME/$RHO_APP/$($TRAVIS_BUILD_DIR/.ci/app_build_root.rb);
fi
# build testable app binary artefact unless otherwise specified by matrix config
- |
if [[ -z $SKIP_BUILD ]]; then
$TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/build_artefact_for_deploy.sh;
fi
#TODO: change this to run specs in auto mode and collect results
- |
if [[ -z $SKIP_TESTS ]]; then
travis_wait 45 $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/$RHO_RUNNER_SCRIPT;
fi
before_deploy:
- mkdir $BUILD_ARTEFACTS_DIR
- "$TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/before_deploy.sh"
deploy:
provider: s3
edge: true
bucket: tau-autobuilds
access_key_id: "$AWS_ACCESS_KEY"
secret_access_key: "$AWS_SECRET_KEY"
skip_cleanup: true
local_dir: "$BUILD_ARTEFACTS_DIR"
upload-dir: '$S3_DEPLOY_DIR/$S3_JOB_DIR-$RHO_TARGET-$RHO_APP'
acl: public_read
region: eu-central-1
on:
all_branches: true
cache:
directories:
- /home/travis/.rvm/
before_cache:
- gem uninstall rho-tau-extensions -a -x --force
- gem uninstall rhoconnect-client -a -x --force
- gem uninstall rhodes -a -x --force
#- gem uninstall bundler -a -x --force
android:
components:
- tools
- platform-tools
- sdkmanager tools
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
- add-on
- extra
- build-tools-28.0.1
- android-28
- android-${RHO_ANDROID_LEVEL:-19}
- addon-google_apis-google-${RHO_ANDROID_LEVEL:-19}
- sys-img-armeabi-v7a-android-${RHO_ANDROID_LEVEL:-19}
# - sys-img-x86-android-28
env:
global:
- PATH=$PATH:/$TRAVIS_BUILD_DIR/.ci
- 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:=$RUBY_VERSION}"
- ANDROID_ABIS="${ANDROID_ABIS:=arm,aarch64}"
- NDK_NUMBER="${NDK_NUMBER:=21}"
- ANDROID_NDK_HOME="${HOME}/android-ndk-r${NDK_NUMBER}"
matrix:
include:
#ios targets
- language: objective-c
os: osx
#osx_image: xcode11.4
env: RHO_TARGET="rhosimulator_osx" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh" RHO_RUBY="ruby-2.7.0"
- language: objective-c
os: osx
#osx_image: xcode11.4
env: RHO_TARGET="iphone" RHO_APP="auto_common_spec" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="ruby-2.7.0"
- language: objective-c
os: osx
osx_image: xcode12
env: RHO_TARGET="iphone" RHO_APP="framework_spec" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="ruby-2.6.5"
# - language: objective-c
# os: osx
# osx_image: xcode11.4
# env: RHO_TARGET="iphone" RHO_APP="sas" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh" RHO_RUBY="ruby-2.4.10"
# - language: objective-c
# os: osx
# osx_image: xcode12
# env: RHO_TARGET="iphone" RHO_APP="universal_push_example" 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" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"
# - language: objective-c
# os: osx
# osx_image: xcode12
# env: RHO_TARGET="iphone" RHO_APP="sas" 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" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"
# - language: objective-c
# os: osx
# osx_image: xcode12
# env: RHO_TARGET="iphone" RHO_APP="todo-nodejs" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh" RHO_TAU_EXTENSIONS="yes"
# - language: objective-c
# os: osx
# osx_image: xcode12
# env: RHO_TARGET="iphone_native_lib" RHO_APP="rhodes_lib_examples" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"
#linux targets
- language: c++
os: linux
env: RHO_TARGET="linux" RHO_APP="auto_common_spec" MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh" RHO_RUBY="ruby-2.5.7"
dist: bionic
addons:
apt:
packages:
- debhelper
- fakeroot
- language: c++
os: linux
env: RHO_TARGET="linux" RHO_APP="framework_spec" MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" RHO_RUNNER_SCRIPT="run_app_on_simulator.sh"
dist: bionic
addons:
apt:
packages:
- debhelper
- fakeroot
#android targets
- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="framework_spec" RHO_ANDROID_LEVEL="21" NDK_NUMBER="21" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="ruby-2.5.7" ANDROID_ABIS="arm,x86"
- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="auto_common_spec" RHO_ANDROID_LEVEL="21" NDK_NUMBER="21" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="ruby-2.6.5"
- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="auto_common_spec" RHO_ANDROID_LEVEL="24" NDK_NUMBER="21" RHO_RUNNER_SCRIPT="run_test_on_simulator.sh" RHO_RUBY="ruby-2.7.1"
# - language: android
# os: linux
# env: RHO_TARGET="android" RHO_APP="sas" RHO_ANDROID_LEVEL="24" NDK_NUMBER="21" SKIP_TESTS=1 RHO_RUBY="ruby-2.3.8"
# - language: android
# os: linux
# env: RHO_TARGET="android" RHO_APP="sas" RHO_ANDROID_LEVEL="27" NDK_NUMBER="21" SKIP_TESTS=1 RHO_RUBY="ruby-2.6.5"
# - language: android
# os: linux
# env: RHO_TARGET="android" RHO_APP="sas" RHO_ANDROID_LEVEL="30" NDK_NUMBER="21" SKIP_TESTS=1 RHO_RUBY="ruby-2.7.1"
- language: android
os: linux
env: RHO_TARGET="android" RHO_APP="rhodes_fcm_test" RHO_ANDROID_LEVEL="21" NDK_NUMBER="21" SKIP_TESTS=1
- language: android
os: linux
env: RHO_TARGET="android_native_lib" RHO_APP="rhodes_lib_examples" RHO_ANDROID_LEVEL="24" NDK_NUMBER="21" SKIP_TESTS=1 RHO_RUBY="ruby-2.3.8"
# - language: android
# os: linux
# env: RHO_TARGET="android" RHO_APP="inventory_demo" RHO_ANDROID_LEVEL="24" NDK_NUMBER="21" SKIP_TESTS=1