-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.travis.yml
147 lines (127 loc) · 4.91 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
env:
global:
# Android
- API=28
- ABI=x86_64
- G_SERVICES=default
- ANDROID_TOOLS=4333796 # android-28
# Flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.12.13+hotfix.5-${FLUTTER_CHANNEL}
# Path
- ANDROID_HOME=${HOME}/android-sdk-linux
- TOOLS=${ANDROID_HOME}/tools
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- PATH="$JAVA_HOME/bin:$PATH"
- FLUTTER_HOME=${HOME}/flutter
- PATH=${HOME}/.pub-cache/bin:${PATH}
- PATH=${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin:${PATH}
branches:
only:
- master
- develop
- travis
jobs:
include:
# Android integration tests
- &integration-test-stage
stage: Integration Testing
os: linux
dist: bionic
language: shell
env: Android tests
git:
depth: 3
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.pub-cache
- flutter
before_cache:
- rm -rf $HOME/.gradle/caches/[1-9]*
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
addons:
apt:
packages:
- libvirt-bin
- bridge-utils
- openjdk-8-jdk-headless
before_install:
# Android tools
- curl -L "https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_TOOLS.zip" -o $HOME/tools.zip
- unzip -oq $HOME/tools.zip -d ${ANDROID_HOME}
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses
# Download SDK tools
- sdkmanager "tools" >/dev/null
- sdkmanager "platform-tools" >/dev/null
- sdkmanager "emulator" >/dev/null
- sdkmanager "platforms;android-$API" >/dev/null # We need the API of the emulator we will run
- sdkmanager "system-images;android-$API;$G_SERVICES;$ABI" >/dev/null # install system images for emulator
- sudo adduser $USER libvirt
# Define emulator parameters
- EMU_PARAMS="
-avd test
-no-audio
-no-window
-no-accel
-gpu swiftshader_indirect
-no-boot-anim
-camera-back none
-camera-front none"
# Create and start emulator as early as possible
- adb start-server
- avdmanager create avd --force --name test --package "system-images;android-$API;$G_SERVICES;$ABI" --abi $ABI --device 'Nexus 4' --sdcard 128M
- $ANDROID_HOME/emulator/emulator ${EMU_PARAMS} &
# Install other required tools:
- sdkmanager "build-tools;28.0.3" >/dev/null # Implicit gradle dependency - gradle drives changes
- sdkmanager "platforms;android-28" >/dev/null # We need the API of the current compileSdkVersion from gradle.properties
- sdkmanager "extras;android;m2repository" >/dev/null
# Install flutter (while emulator is starting)
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
- if [ ! -f $HOME/flutter/bin/flutter ] ; then
git clone https://github.com/flutter/flutter.git $FLUTTER_HOME -b beta;
flutter pub get;
fi
# Download the script to wait for emulator
- curl -L https://raw.githubusercontent.com/travis-ci/travis-cookbooks/master/community-cookbooks/android-sdk/files/default/android-wait-for-emulator -o $HOME/bin/android-wait-for-emulator
- chmod +x $HOME/bin/android-wait-for-emulator
- chmod -R +x $FLUTTER_HOME
# Wait for emulator to finish startup
- android-wait-for-emulator
# Unlock screen
- adb shell input keyevent 82 &
script:
- cd example
- flutter drive --target=test_driver/backendless_tests.dart --driver=test_driver/backendless_driver.dart
# iOS integration tests
- <<: *integration-test-stage
os: osx
language: objective-c
osx_image: xcode11
env: iOS tests
git:
depth: 3
before_install:
- open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
# - brew update
- brew install libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- sudo gem install cocoapods
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- if [ ! -f $HOME/flutter/bin/flutter ] ; then
git clone https://github.com/flutter/flutter.git $FLUTTER_HOME -b beta;
flutter pub get;
fi
# - flutter packages pub run build_runner build --delete-conflicting-outputs
cache:
directories:
- $HOME/.pub-cache
- flutter
notifications:
email: