forked from connectbot/connectbot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
99 lines (93 loc) · 4.02 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
language: minimal
os: linux
dist: bionic
sudo: true # For the 7.5GB limit
branches:
except:
- /^dependabot\/.*/
- /^git-v.*$/
- /^translations\/import$/
env:
global:
- EMU_ABI=x86_64
- EMU_API=28
- EMU_FLAVOR=default
- ANDROID_TOOLS_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
- ANDROID_HOME="$HOME/android-sdk-linux"
- JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
- PATH="$JAVA_HOME/bin:$HOME/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
- TERM=dumb
# Coverity
- secure: "DTBBKdwZE5yxPjJQG8/wU/+LJ1A3MtUYNaf8O/yhmQNo4UcxQF+3KOoY5OK4vvoTewisUqnVRhXhD8rMYzBZiNtaGF8eSMGXVWUVb6YhOPQ0oMHKSmVgopEHzhoGa+9HDJ6xyQZdALJB8GVlwamTwO/1qk/xI02mjUNEtdk8cuc="
cache:
directories:
- $HOME/.cache/ci-support
- $HOME/.cache/lint
- $HOME/.cache/ndk
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_cache:
- find $HOME/.gradle -name "*.lock" -exec rm {} \;
- rm -rf $HOME/.gradle/caches/[1-9]*
addons:
apt:
packages:
- clang-5.0
- inotify-tools
- openjdk-8-jdk-headless # for building
- xqilla # ./ci/check-lint-count.bash
- qemu-kvm # for emulator
- libvirt-bin # for emulator
- ubuntu-vm-builder # for emulator
- bridge-utils # for emulator
coverity_scan:
project:
name: "connectbot/connectbot"
description: "The first SSH client for Android."
notification_email: [email protected]
build_command_prepend: "./gradlew clean"
build_command: "./gradlew assemble"
branch_pattern: coverity_scan
before_script:
# Install Android stuff
- curl -L $ANDROID_TOOLS_URL -o $HOME/tools.zip
- unzip -oq $HOME/tools.zip -d $ANDROID_HOME
- yes | sdkmanager --licenses
- sdkmanager tools | tr '\r' '\n' | uniq
- sdkmanager platform-tools | tr '\r' '\n' | uniq
- sdkmanager emulator | tr '\r' '\n' | uniq
- sdkmanager "platforms;android-${EMU_API}" | tr '\r' '\n' | uniq
- sdkmanager "system-images;android-${EMU_API};${EMU_FLAVOR};${EMU_ABI}" | tr '\r' '\n' | uniq
# Allow use of KVM
- sudo adduser $USER libvirt
- sudo adduser $USER kvm
# Create and start emulator as early as possible
- adb start-server
- avdmanager create avd --force --name test --package "system-images;android-${EMU_API};${EMU_FLAVOR};${EMU_ABI}" --abi ${EMU_ABI} --device 'Nexus 4' --sdcard 128M
- sudo -E sudo -u $USER -E bash -c "$ANDROID_HOME/emulator/emulator -avd test -skin 768x1280 -no-audio -no-window -no-boot-anim -no-snapshot -camera-back none -camera-front none -qemu -m 2048 &"
- sdkmanager 'build-tools;29.0.3' | tr '\r' '\n' | uniq
- sdkmanager 'platforms;android-29' | tr '\r' '\n' | uniq
- sdkmanager 'extras;android;m2repository' | tr '\r' '\n' | uniq
- sdkmanager 'extras;google;m2repository' | tr '\r' '\n' | uniq
- sdkmanager 'extras;google;google_play_services' | tr '\r' '\n' | uniq
- sdkmanager 'ndk;21.3.6528147' | tr '\r' '\n' | uniq
# Download the emulator support stuff
- mkdir -p $HOME/.cache/ci-support
- curl -L https://github.com/connectbot/ci-support/archive/master.zip -z $HOME/.cache/ci-support/master.zip -o $HOME/.cache/ci-support/master.zip
- unzip -oq $HOME/.cache/ci-support/master.zip -d $HOME
- mkdir -p $HOME/bin
- 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
# For the lint checking mechanism
- mkdir -p $HOME/.cache/lint
# Try to download Gradle deps while Android is booting
- ./gradlew --parallel -Dorg.gradle.parallel.intra=true resolveDependencies
script:
# Split up to reduce memory requirements
- ./gradlew --stacktrace assemble
- ./gradlew --stacktrace check
- android-wait-for-emulator
- ./gradlew --stacktrace connectedCheck
- ./gradlew --stacktrace lint
- ./ci/check-lint-count.bash app/build/reports/lint-results.xml $HOME/.cache/lint/lint-results.xml
after_success: ./gradlew coveralls