forked from google/conscrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
128 lines (111 loc) · 5 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
language: android
env:
global:
- BORINGSSL_HOME="$HOME/boringssl"
- CC=clang
- CXX=clang++
- CXXFLAGS="-std=c++11"
- GOOGLE_JAVA_FORMAT_VERSION=1.1
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/dists/
matrix:
include:
###
### Linux build is the only platform that builds Android here.
###
- os: linux
jdk: openjdk8
sudo: false
env:
- ANDROID_TOOLS_URL="https://dl.google.com/android/repository/tools_r25.2.3-linux.zip"
- ANDROID_HOME="$HOME/android-sdk-linux"
- ANDROID_NDK_HOME="$ANDROID_HOME/ndk-bundle"
- JAVA6_HOME=/usr/lib/jvm/java-6-openjdk-amd64
before_install:
- curl -L $ANDROID_TOOLS_URL -o $HOME/tools.zip
- unzip -q $HOME/tools.zip -d $ANDROID_HOME
- mkdir $ANDROID_HOME/licenses
- echo -ne "\n8933bad161af4178b1185d1a37fbf41ea5269c55\n\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> $ANDROID_HOME/licenses/android-sdk-license
- echo -ne "\n84831b9409646a918e30573bab4c9c91346d8abd\n" >> $ANDROID_HOME/licenses/android-sdk-preview-license
# sdkmanager 26.1.1 produces an enormous amount of progress info
# Append tr '\r' '\n' | uniq to all the commands to suppress it
- $ANDROID_HOME/tools/bin/sdkmanager tools | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager platform-tools | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'build-tools;25.0.0' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'platforms;android-25' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'extras;android;m2repository' | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager --channel=1 ndk-bundle | tr '\r' '\n' | uniq
- $ANDROID_HOME/tools/bin/sdkmanager 'cmake;3.6.4111459' | tr '\r' '\n' | uniq
addons:
apt:
sources:
- kalakris-cmake
- llvm-toolchain-precise-3.9 # for clang-format-3.9
- ubuntu-toolchain-r-test
packages:
- clang-3.9
- clang-format-3.9 # for style checks
- cmake
- g++-multilib
- gcc-multilib
- libc6-dev-i386
- libc6-dev:i386
- ninja-build
- openjdk-6-jre # for running tests with Java 6
###
### MacOS build only does x86-64.
###
- os: osx
osx_image: xcode8
before_install:
- brew update
- brew install ninja
- export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
before_cache:
- find $HOME/.gradle -name "*.lock" -exec rm {} \;
- rm -rf $HOME/.gradle/caches/[1-9]*
before_script:
# Get Google Java Format
- curl -L https://github.com/google/google-java-format/releases/download/google-java-format-1.1/google-java-format-${GOOGLE_JAVA_FORMAT_VERSION}-all-deps.jar -o $HOME/gjf.jar
# get BoringSSL
- mkdir $BORINGSSL_HOME
- git clone --depth 1 https://boringssl.googlesource.com/boringssl $BORINGSSL_HOME
# Build BoringSSL for 64-bit
- mkdir $BORINGSSL_HOME/build64 && pushd $BORINGSSL_HOME/build64
- cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_ASM_FLAGS=-Wa,--noexecstack -GNinja ..
- ninja
- popd
# Get git-clang-format
- if [ ! -d "$HOME/bin" ]; then mkdir $HOME/bin; fi
- curl -L https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/git-clang-format -o $HOME/bin/git-clang-format
- chmod 0755 $HOME/bin/git-clang-format
- export PATH="$HOME/bin:$PATH"
# We need this to find the merge-base
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" != "false" ]];
then
git fetch origin +refs/heads/${TRAVIS_BRANCH}:refs/remotes/origin/${TRAVIS_BRANCH};
fi
script:
# MacOS (BSD) xargs is missing some nice features that make this easy, so skip it.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" != "false" ]];
then
git rev-list $(git merge-base HEAD origin/master)..HEAD | xargs -i git clang-format --binary=$(which clang-format-3.9) --style=file --diff {}^ {} | ( git apply; true ) && git diff --exit-code || { git reset --hard; false; }
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" != "false" ]];
then
git rev-list $(git merge-base HEAD origin/master)..HEAD | xargs -i git diff-tree --no-commit-id --name-only -r {} | grep -E '\.java$' | xargs -r git ls-files | xargs -r java -jar $HOME/gjf.jar -a -i --fix-imports-only && git diff --exit-code || { git reset --hard; false; }
fi
- ./gradlew build -PcheckErrorQueue
# Also test with Java 6 on linux
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" != "false" ]];
then
${JAVA6_HOME}/bin/java -version;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" != "false" ]];
then
./gradlew check -DjavaExecutable64=${JAVA6_HOME}/bin/java -PcheckErrorQueue;
fi
after_script:
- "[ -f android/build/outputs/lint-results-debug.xml ] && cat android/build/outputs/lint-results-debug.xml"