-
Notifications
You must be signed in to change notification settings - Fork 43
/
.travis.yml
165 lines (150 loc) · 7.27 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
env:
global:
- FLUTTER_CHANNEL=stable
- FLUTTER_VERSION=1.12.13+hotfix.8-${FLUTTER_CHANNEL}
- ANDROID_SDK_TOOLS=sdk-tools-darwin-4333796.zip # older sdkmanager
# - ANDROID_SDK_TOOLS=commandlinetools-mac-6200805_latest.zip # latest sdkmanager
- ANDROID_PLATFORM_SDK=28
- ANDROID_BUILD_TOOLS=28.0.3
- GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/"
- JDK_SDKMANAGER="1.8" # the JDK used by sdkmanager
- JDK="1.8" # the JDK used by build and tests
jobs:
include:
- stage: Run sylph
env: Run Unit Tests
language: dart
dart: stable
os: linux
before_script: # exits build if tests fail
- pub run test test/all_tests.dart
- pub global activate coverage
script:
- script/code_coverage.sh
after_success: bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info
- stage: Run sylph
env: Run Sylph on Mac
os: osx
osx_image: xcode11.3
# only build on tag releases
if: tag IS present
before_install:
# Set up JDK 8 for Android SDK
- java -version
- curl "${GRAVIS}.install-jdk-travis.sh" --output ~/.install-jdk-travis.sh
- export TARGET_JDK="${JDK}"
- JDK="${JDK_SDKMANAGER}" # used when running sdkmanager
- source ~/.install-jdk-travis.sh
- java -version
# Add missing java module used by sdkmanager, etc...
# - export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
# Install android tools
- export ANDROID_HOME=~/android-sdk
- wget -q "https://dl.google.com/android/repository/$ANDROID_SDK_TOOLS" -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- PATH=${PATH}:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Silence warning.
- mkdir -p ~/.android
- touch ~/.android/repositories.cfg
# - sdkmanager --sdk_root=$ANDROID_HOME --version
- sdkmanager --version
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses > /dev/null
# - sdkmanager --list | head -15
# Platform and build tools
- sdkmanager "tools" "platform-tools" "platforms;android-${ANDROID_PLATFORM_SDK}" "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null
# - sdkmanager --list | head -15
- sdkmanager --version
# Switch back to our target JDK version to build and run tests
# - JDK="${TARGET_JDK}"
# - source ~/.install-jdk-travis.sh
# fix timezone warning on osx
- sudo ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
# setup osx environment for flutter
# - 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
- 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
# install aws
- curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
- unzip awscli-bundle.zip
- sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
- aws --version
- cp -r .aws ~
# install most current (released or unreleased) version of Sylph
- pub global activate --source path .
script:
- cd example/default_app; sylph
# - cd example/flavors; sylph
# publish artifacts to GitHub
before_deploy:
# bundle artifacts for publishing
- (cd /tmp; zip -r /tmp/sylph_artifacts.zip sylph_artifacts)
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: OCyFLrBnorKGT3g7uf0BClF85lb+d6KDcvAvZvEiAec4P1GoaYoxz7iXAYEQ7rLBp1QYu94sW6diM2vd4g9V3NAGQAMzFLdVYkIyueHXE+PW4Z4i5SFm8d8VSTck1SCN4gBtd1j3pKbFCMH8637lrZ24uz46f4Gk4qlQ1PVbfkSIFm/eKTtFzRQO4XCOiMj+sHd/M72+jhfzDhwXAi7cG6Qf+cPpvAGLK7mZvsjg6UBrYltn7sOhG6P8XO927GXz/N8VutHvz6Ip0c0yNXpjoMiNub2YMzAxNmnxurabxDhZubtEqwn5bwohOce6mxqC3z6MH5Xq8RUW7BpmpFakHw+usFp1tTQ3QSBeVblZTX++wOzEnvF9vGh0IhMDr8iJBYFGjQtpJyW2Iz0EaU5W64Qh/FxCjgpyqN2hOQY43wLxnK3vpoBiqKOV+ZscXEgyJF0pfnMbFjahU/b/mbGbu6EmQvkWFxN5xnPH0qQ0u2yIlvDydgzWmX3nEjuYTBVFn3eEfQAfjZOEP9bmo3cK4ObyQSaqQAVJPS+ZCkGRlF7WPzJtWQX6kl9wNSAG94dq6MQ8dl/7NrIr1JXNxwcTb/q8CuYEpq6ZrbMlaFCFvgdFdpKqZCoCkD284wnyUUQUDLM3O6Tr2nYNTLHVGriPhcRSjdCVvZYDWo4wx1WYbAY=
file: /tmp/sylph_artifacts.zip
on:
tags: true
# - stage: Run sylph
# env: Run Sylph on linux
# dist: trusty # defaults to java 1.8
# os: linux
# # only build on tag releases
# if: tag IS present
# before_install:
# - |
# if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(.md)|^(LICENSE)|^(appveyor.yml)'
# then
# echo "Not running CI since only docs were changed."
# exit
# fi
#
# # Add missing java module used by sdkmanager, etc...
## - export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
#
# # Install android tools
# - export ANDROID_HOME=~/android-sdk
# - wget -q "https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_TOOLS.zip" -O android-sdk-tools.zip
# - unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
# - rm android-sdk-tools.zip
# - PATH=${PATH}:${ANDROID_HOME}/emulator:${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 > /dev/null
# - sdkmanager --list | head -15
# # Platform and build tools
# - sdkmanager "tools" "platform-tools" "platforms;android-${ANDROID_PLATFORM_SDK}" "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null
# - sdkmanager --list | head -15
#
# # install pre-compiled flutter
## - sudo apt-get install -y --no-install-recommends lib32stdc++6 libstdc++6 > /dev/null
# - 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
#
# # install aws
# - curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
# - unzip awscli-bundle.zip
# - sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
# - aws --version
# - cp -r .aws ~
#
# # install most current (released or unreleased) version of Sylph
# - pub global activate --source path .
#
# script:
# - cd example/default_app; sylph -c sylph_android.yaml -v