forked from EsotericSoftware/kryo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (45 loc) · 1.92 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
# use container
sudo: false
language: java
env:
global:
# Check if version is a SNAPSHOT - grep returns 0 if the pattern is found, otherwise 1
- IS_SNAPSHOT=$(grep -A 1 "<artifactId>kryo.*</artifactId>" pom.xml | grep SNAPSHOT)
- SONATYPE_USERNAME=martin.grotzke
- secure: kCOLgEveEDprSL3fOBeCc1/nmHVYEcNh/lRRWiJywFehOzKBTBF40pAWX7JtsWUPG8aPKGYFEE4sjYd+DF2DRknbuB2ZfAEgs9Xp9h5Mx1KztJYNiCfEnLciBBRDXA7t1M3TLKyT3ptA+Kk307cH2QHv9sUUnhnf0IofJyQhQvA=
jdk:
#- openjdk7
- oraclejdk8
before_install:
# required for testing jdk 11
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh -O $TRAVIS_BUILD_DIR/install-jdk.sh
- chmod u+x $TRAVIS_BUILD_DIR/install-jdk.sh
install:
# compile and test java 8
- mvn -B -V clean test
script:
# compile tests with java 8
- jdk_switcher use oraclejdk8
- mvn -B clean install
# test java 9 (only available via oraclejdk9)
- jdk_switcher use oraclejdk9
- mvn -v && mvn -B test
# test java 11
# see also https://docs.travis-ci.com/user/languages/java/#using-java-10-and-later
# and https://github.com/sormuras/bach#install-jdksh (because default travis docs didn't work)
- export JAVA_HOME=$HOME/openjdk11
- $TRAVIS_BUILD_DIR/install-jdk.sh --feature 11 --target $JAVA_HOME
- mvn -v && mvn -B test
# install and publish snapshot with java 8
# not via `after_success` but directly in `script`, since a failure would be silently ignored in `after_success`, which
# is documented in https://docs.travis-ci.com/user/customizing-the-build#Breaking-the-Build
- jdk_switcher use oraclejdk8
- if [ $TRAVIS_BRANCH = "master" ] && [ $TRAVIS_PULL_REQUEST = "false" ] && [ $IS_SNAPSHOT ]; then
mvn -v && mvn -B -P requireSnapshot -DskipTests=true deploy --settings build/settings-sonatype.xml;
else
echo "Skipping deployment...";
fi
#- mvn -B -P requireSnapshot -DskipTests=true deploy --settings .settings.xml
cache:
directories:
- $HOME/.m2