forked from alibaba/transmittable-thread-local
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
100 lines (91 loc) · 3.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
language: java
# how to install and set jdk on travis:
# - Testing Against Multiple JDKs
# https://docs.travis-ci.com/user/languages/java/#Testing-Against-Multiple-JDKs
# - JVM images
# https://docs.travis-ci.com/user/reference/trusty/#JVM-(Clojure%2C-Groovy%2C-Java%2C-Scala)-images
# - Customizing the Build / Build Matrix
# https://docs.travis-ci.com/user/customizing-the-build/#Build-Matrix
addons:
apt:
packages:
- openjdk-6-jdk
jdk:
- oraclejdk8
before_install:
# workaroud for "buffer overflow detected" problem of openjdk:
# https://github.com/travis-ci/travis-ci/issues/5227
# borrow from https://github.com/miguno/kafka-storm-starter/blob/01dd534263eb867304c06cd2a72f640da1bd9367/.travis.yml
- cat /etc/hosts # optionally check the content *before*
- sudo hostname "$(hostname | cut -c1-63)"
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts > /tmp/hosts
- sudo mv /tmp/hosts /etc/hosts
- cat /etc/hosts # optionally check the content *after*
# https://docs.travis-ci.com/user/languages/java/#Using-Java-10-and-later
# https://github.com/sormuras/bach/blob/master/install-jdk.sh
- mkdir -p "$HOME/.jdk"
- install_jdk_bin="$HOME/.jdk/install-jdk.sh"
- if [ ! -f "$install_jdk_bin" ]; then wget https://github.com/sormuras/bach/raw/master/install-jdk.sh -O "$install_jdk_bin"; chmod +x "$install_jdk_bin"; fi
# output env info
- ls -l /usr/lib/jvm && ls /usr/lib/jvm/*
- echo -e "JAVA_HOME=$JAVA_HOME\nPATH=$PATH"
- ./mvnw --version
install:
- pip install --user codecov
script:
# default oracle jdk 8, do build and test
- ./mvnw clean install --batch-mode
- ./scripts/run-agent-test.sh
# open jdk 6
- jdk_switcher use openjdk6
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# open jdk 7
- jdk_switcher use openjdk7
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# open jdk 8
- jdk_switcher use openjdk8
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# oracle jdk 9
- jdk_switcher use oraclejdk9
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# open jdk 9
- export JAVA_HOME=$HOME/.jdk/openjdk9
- if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 9 --license GPL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# oracle jdk 10
- export JAVA_HOME=$HOME/.jdk/oraclejdk10
- if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 10 --license BCL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# open jdk 10
- export JAVA_HOME=$HOME/.jdk/openjdk10
- if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 10 --license GPL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# open jdk 11
- export JAVA_HOME=$HOME/.jdk/openjdk11
- if [ ! -d "$JAVA_HOME" ]; then "$install_jdk_bin" --feature 11 --license GPL --target $JAVA_HOME; fi
- ./scripts/run-junit.sh skipClean
- ./scripts/run-agent-test.sh skipClean
# codecov
- jdk_switcher use oraclejdk8
- mvn clean -V
- mvn cobertura:cobertura
after_success:
- codecov
- git status
# Caching Dependencies and Directories
# https://docs.travis-ci.com/user/caching/
cache:
directories:
- $HOME/.m2
- $HOME/.jdk
- $HOME/.cache/pip
before_cache:
# clear TTL maven self install
- rm -rf $HOME/.m2/repository/com/alibaba/transmittable-thread-local