Skip to content

Commit 4b695b7

Browse files
hypery2ksis0k0
authored andcommitted
ci(travis): utilize stages and add Android and iOS builds (#1176)
1 parent 010fed7 commit 4b695b7

File tree

2 files changed

+144
-43
lines changed

2 files changed

+144
-43
lines changed

Diff for: .travis.yml

+136-41
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,143 @@
11
env:
22
global:
3-
- NODE_VERSION=8.9.0
4-
- EMULATOR_API_LEVEL=19
5-
- ANDROID_VERSION=25
6-
- ANDROID_BUILD_TOOLS_VERSION=25.0.2
7-
- ANDROID_ABI=armeabi-v7a
8-
- APPIUM_VERSION=1.7.0
9-
- EMULATOR_NAME=test
10-
language: android
11-
jdk:
12-
- oraclejdk8
3+
- NODE_VERSION=6
4+
- NODE_VERSION=8
5+
- EMULATOR_API_LEVEL=22
6+
- ANDROID_VERSION=25
7+
- ANDROID_BUILD_TOOLS_VERSION=26.0.2
8+
- ANDROID_ABI=armeabi-v7a
9+
- APPIUM_VERSION=1.7.0
10+
- EMULATOR_NAME=test
11+
- ANDROID_TAG=google_apis
12+
13+
matrix:
14+
include:
15+
- stage: "Lint"
16+
language: node_js
17+
os: linux
18+
before_install:
19+
- nvm install $NODE_VERSION
20+
script:
21+
- cd nativescript-angular
22+
- npm install
23+
- npm run tslint
24+
- stage: "Build"
25+
os: osx
26+
env:
27+
- Build="iOS"
28+
osx_image: xcode8.3
29+
language: node_js
30+
node_js: "6"
31+
jdk: oraclejdk8
32+
before_install:
33+
- cd nativescript-angular
34+
- npm install
35+
- cd ../tests
36+
- npm install
37+
- cd ..
38+
script:
39+
- cd nativescript-angular
40+
- npm run ngc
41+
- cd ../tests
42+
- tns build ios
43+
- os: osx
44+
env:
45+
- Build="iOS"
46+
osx_image: xcode8.3
47+
language: node_js
48+
node_js: "8"
49+
jdk: oraclejdk8
50+
before_install:
51+
- cd nativescript-angular
52+
- npm install
53+
- cd ../tests
54+
- npm install
55+
- cd ..
56+
script:
57+
- cd nativescript-angular
58+
- npm run ngc
59+
- cd ../tests
60+
- tns build ios
61+
- language: android
62+
node_js: "6"
63+
os: linux
64+
env:
65+
- Build="Android"
66+
jdk: oraclejdk8
67+
before_install:
68+
- echo no | android create avd --force -n $EMULATOR_NAME -t "android-"$EMULATOR_API_LEVEL --abi $ANDROID_ABI --tag $ANDROID_TAG -c 12M
69+
- QEMU_AUDIO_DRV=none emulator -avd $EMULATOR_NAME -no-window &
70+
- nvm install $NODE_VERSION
71+
- cd nativescript-angular
72+
- npm install
73+
- cd ../tests
74+
- npm install
75+
- cd ..
76+
- android-wait-for-emulator
77+
- adb shell input keyevent 82 &
78+
script:
79+
- cd nativescript-angular
80+
- npm run ngc
81+
- cd ../tests
82+
- tns build android
83+
- language: android
84+
node_js: "8"
85+
os: linux
86+
env:
87+
- Build="Android"
88+
jdk: oraclejdk8
89+
before_install:
90+
- echo no | android create avd --force -n $EMULATOR_NAME -t "android-"$EMULATOR_API_LEVEL --abi $ANDROID_ABI --tag $ANDROID_TAG -c 12M
91+
- QEMU_AUDIO_DRV=none emulator -avd $EMULATOR_NAME -no-window &
92+
- nvm install $NODE_VERSION
93+
- cd nativescript-angular
94+
- npm install
95+
- cd ../tests
96+
- npm install
97+
- cd ..
98+
- android-wait-for-emulator
99+
- adb shell input keyevent 82 &
100+
script:
101+
- cd nativescript-angular
102+
- npm run ngc
103+
- cd ../tests
104+
- tns build android
105+
13106
android:
14107
components:
15-
- tools
16-
- platform-tools
17-
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
18-
- android-$ANDROID_VERSION
19-
- android-$EMULATOR_API_LEVEL
20-
- extra-android-support
21-
- extra-android-m2repository
22-
- sys-img-$ANDROID_ABI-android-$EMULATOR_API_LEVEL
108+
- tools
109+
- platform-tools
110+
- build-tools-25.0.2
111+
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
112+
- android-25
113+
- android-$EMULATOR_API_LEVEL
114+
- extra-google-google_play_services
115+
- extra-google-m2repository
116+
- extra-android-m2repository
117+
- addon-google_apis-google-25
118+
# Specify at least one system image,
119+
# if you need to run emulator(s) during your tests
120+
- sys-img-armeabi-v7a-android-26
121+
- sys-img-armeabi-v7a-android-25
122+
- sys-img-armeabi-v7a-android-17
123+
- sys-img-armeabi-v7a-android-19
124+
- sys-img-armeabi-v7a-google_apis-$EMULATOR_API_LEVEL
125+
licenses:
126+
- ".+"
127+
23128
before_cache:
24-
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
129+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
130+
25131
cache:
26-
directories:
27-
- "$HOME/.gradle/caches/"
28-
- "$HOME/.gradle/wrapper/"
132+
directories:
133+
- .nvm
134+
- $HOME/.gradle/caches/
135+
- $HOME/.gradle/wrapper/
136+
29137
install:
30-
- nvm install $NODE_VERSION
31-
- npm install -g typings
32-
- echo y | $ANDROID_HOME/tools/android update sdk --filter tools --all --no-ui
33-
- wget -O ./nativescript.tgz "https://s3.amazonaws.com/nativescript-ci/build_result/nativescript.tgz"
34-
- npm install -g nativescript.tgz --ignore-scripts
35-
- tns usage-reporting disable
36-
- tns error-reporting disable
37-
- cd nativescript-angular
38-
- npm install
39-
- npm run tslint
40-
- cd ../tests
41-
- npm install
42-
before_script:
43-
- echo no | android create avd --force -n $EMULATOR_NAME -t android-$EMULATOR_API_LEVEL --abi $ANDROID_ABI -c 12M
44-
- emulator -avd $EMULATOR_NAME -no-skin -no-audio -no-window &
45-
- android-wait-for-emulator
46-
script:
47-
- tns build android
48-
- android-wait-for-emulator
138+
- nvm install $NODE_VERSION
139+
- npm install -g typings
140+
- wget -O ./nativescript.tgz "https://s3.amazonaws.com/nativescript-ci/build_result/nativescript.tgz"
141+
- npm install -g nativescript.tgz --ignore-scripts
142+
- tns usage-reporting disable
143+
- tns error-reporting disable

Diff for: tests/package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"nativescript": {
3-
"id": "org.nativescript.ngtests"
3+
"id": "org.nativescript.ngtests",
4+
"tns-ios": {
5+
"version": "next"
6+
},
7+
"tns-android": {
8+
"version": "next"
9+
}
410
},
511
"name": "ngtests",
612
"main": "app.js",
@@ -68,4 +74,4 @@
6874
"compile-tests-w": "tsc -p e2e --watch",
6975
"update-app-ng-deps": "update-app-ng-deps"
7076
}
71-
}
77+
}

0 commit comments

Comments
 (0)