-
Notifications
You must be signed in to change notification settings - Fork 9
/
.travis.yml
100 lines (91 loc) · 4.52 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
jobs:
include:
- stage: Unit Testing
language: generic
os: linux
env: running unit and widget tests with code coverage
before_script:
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
# install pre-compiled flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz && tar xf flutter.tar.xz > /dev/null && rm flutter.tar.xz
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
- pub global activate coverage
script: flutter test --coverage
after_success: bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info
- &integration-test-stage
stage: Integration Testing
sudo: true
dist: trusty
language: generic
os: linux
env: running driver on emulator
# Run integration tests on android
before_install:
- sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
# Install the Android SDK Dependency.
- export ANDROID_HOME=/opt/android-sdk-linux
- cd /opt
- wget -q https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- cd -
- PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Silence warning.
- mkdir -p ~/.android
- touch ~/.android/repositories.cfg
# 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 --list | head -15
# install older packages (for emulator)
- sdkmanager "build-tools;25.0.2" "platforms;android-25" > /dev/null
# Create and start emulator.
- EMULATOR_API_LEVEL=22
- ANDROID_ABI="default;armeabi-v7a"
- sdkmanager "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI" > /dev/null
- sdkmanager --list | head -15
- echo no | avdmanager create avd --force -n test -k "system-images;android-$EMULATOR_API_LEVEL;$ANDROID_ABI"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window -gpu swiftshader &
# install pre-compiled flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.tar.xz https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/linux/flutter_linux_v${FLUTTER_VERSION}.tar.xz && tar xf flutter.tar.xz > /dev/null && rm flutter.tar.xz
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
# Wait for emulator to finish startup.
- ./script/android-wait-for-emulator.sh
- adb shell input keyevent 82
- flutter devices
script: travis_retry flutter driver test_driver/main.dart
- <<: *integration-test-stage
os: osx
# use oldest flutter supported version of xcode
osx_image: xcode8.0
env: running driver on simulator
# Run integration tests on ios
before_install:
- open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
- export HOMEBREW_NO_AUTO_UPDATE=1
- brew install libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- brew install cocoapods || echo 'ignore exit(1)'
- brew link --overwrite cocoapods
# install pre-compiled flutter
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.0.0-${FLUTTER_CHANNEL}
- wget --quiet --output-document=flutter.zip https://storage.googleapis.com/flutter_infra/releases/${FLUTTER_CHANNEL}/macos/flutter_macos_v${FLUTTER_VERSION}.zip && unzip -qq flutter.zip > /dev/null && rm flutter.zip
- export PATH="$PATH":"$HOME/.pub-cache/bin"
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor -v
- stage: Ready to deploy
os: osx
language: generic
env: not implemented 🤓
script: echo "Deploying to store ..."