forked from phoedos/pmd
[ci] Use openjdk11 for building, add osx into the build matrix
* Allow travis to cache jdk * cache $HOME/.rvm, install bundler with current rvm ruby (needed for osx)
This commit is contained in:
39
.travis.yml
39
.travis.yml
@ -1,5 +1,3 @@
|
||||
dist: trusty
|
||||
sudo: false
|
||||
addons:
|
||||
ssh_known_hosts:
|
||||
- web.sourceforge.net
|
||||
@ -16,14 +14,33 @@ env:
|
||||
- secure: "geOU/7VR83KYTOCR5XkgFqnHJEnXeB6hNDE7UFcN4ZsL9uVLhxlDVWV3ujJ87nyBzggG1KfSnUx11UwOQrbBl0K6sEXo/B2q5ytOsWoSLi7+0qm/uhhw/DTBOq57p8TIDKFM7rDhO7uajSn7Y86LeZkh9wIs5265Fh1yhCkiPbczDUMsX4P0GGg2qgkIKSBw4DZf6sPDc4xjJq/4/cLnjXo/K0ZYAIoSLqDfe1gmkzMtQlad+1t8Lwv/gOJ4BNRF4a5aEvGF6kbFovFoeFWCQTKlkn6VJtY+BETGKW2RH9efGeMs7JbBbNm+nnpoNsbJ0gdmGlhSbWT8enIm72/P0ThTBJWVcLJ30tUd0UeYD9C49wbJ3RHSxsoUKP9YhHJ+XKNx+8irkJ8LPCkNMQEFE153gEVvU7tCgah9Uq6laYZv9cQE0dWzNt3//Ymls8BzY38Ha4PbrIIJqEuWwnAX6ZgTgzVtXx1AJjkDFG9KFKPhN7NfNMbh7rn5C84a1h5zrIydm+6RcIBC+xTLDEiN7djiquf3PcNtyGLcO8dNN4Uv8iU0Jw8ch3+w0PJO53v5py+IS1V8pwwYaYF2iVPOoziS0tP8MsgYVGwpTZhvz3v8x0ge8r6KJE4zdvoPtCRNr2Oo3sJGYqkt86Hu6agKFiljP5AgJNx7iQD5GQn6J3w="
|
||||
- secure: "gqyPF3d75JuwZptnQQQKO6rGUILXGO09y9dZhShdX8qq5Mexa2ISk77Y/b0yyAdhJMgEglls5cWlbHkwCAB0i4yL25RE5CtQUe4er+CIKwBIs0M56ghbcOwWAFB/cXeyyWmXDHB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mghttsiJdKlt4CVSYOJUMus6kU32G95hdTgKblsX4J1Of2i1nYsjyMKh3k945tqXwQrIsxOOQug0oIkz24zlLaOaQcorWtJ6Y1HPaZKpVIFUEF0y8Uq/O4oB2bOYC6WDUQfpj7nRG6xbi+BeBS84m1ttCEk4g="
|
||||
matrix:
|
||||
- BUILD=deploy
|
||||
- BUILD=doc
|
||||
- BUILD=sonar
|
||||
- BUILD=coveralls
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- name: "linux - mvn deploy"
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: false
|
||||
env: BUILD=deploy
|
||||
- name: "linux - build documentation"
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: false
|
||||
env: BUILD=doc
|
||||
- name: "linux - run sonar"
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: false
|
||||
env: BUILD=sonar
|
||||
- name: "linux - run coveralls"
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: false
|
||||
env: BUILD=coveralls
|
||||
- name: "macosx - mvn verify"
|
||||
os: osx
|
||||
env: BUILD=deploy
|
||||
|
||||
before_install:
|
||||
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
|
||||
@ -31,9 +48,10 @@ before_install:
|
||||
- bash .travis/configure-maven.sh
|
||||
- rvm install 2.4.1
|
||||
- rvm use 2.4.1
|
||||
# Install OracleJDK 10 - see https://sormuras.github.io/blog/2018-03-20-jdk-matrix.html
|
||||
# Install OpenJDK 11 - see https://sormuras.github.io/blog/2018-03-20-jdk-matrix.html
|
||||
install:
|
||||
- . ./install-jdk.sh -F 10 -L BCL
|
||||
- . ./install-jdk.sh -F 11 -L GPL -W $HOME/jdk
|
||||
- gem install bundler
|
||||
- bundle install
|
||||
before_script: true
|
||||
script: source .travis/build-$BUILD.sh
|
||||
@ -71,7 +89,8 @@ notifications:
|
||||
cache:
|
||||
directories:
|
||||
- "$HOME/.m2"
|
||||
|
||||
- "$HOME/jdk"
|
||||
- "$HOME/.rvm/"
|
||||
|
||||
# Secure Keys, that need to be set for snapshot builds
|
||||
#
|
||||
|
@ -48,7 +48,12 @@ log_info "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
|
||||
|
||||
MVN_BUILD_FLAGS="-B -V"
|
||||
|
||||
if travis_isPullRequest; then
|
||||
if travis_isOSX; then
|
||||
|
||||
log_info "The build is running on OSX"
|
||||
./mvnw verify $MVN_BUILD_FLAGS
|
||||
|
||||
elif travis_isPullRequest; then
|
||||
|
||||
log_info "This is a pull-request build"
|
||||
./mvnw verify $MVN_BUILD_FLAGS
|
||||
|
@ -10,6 +10,7 @@ echo "TRAVIS_SECURE_ENV_VARS: ${TRAVIS_SECURE_ENV_VARS}"
|
||||
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
|
||||
echo "TRAVIS_TAG: ${TRAVIS_TAG}"
|
||||
echo "TRAVIS_ALLOW_FAILURE: ${TRAVIS_ALLOW_FAILURE}"
|
||||
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
|
||||
|
||||
function travis_isPullRequest() {
|
||||
if [ "${TRAVIS_REPO_SLUG}" != "pmd/pmd" ] || [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
|
||||
@ -27,6 +28,14 @@ function travis_isPush() {
|
||||
fi
|
||||
}
|
||||
|
||||
function travis_isOSX() {
|
||||
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function has_docs_change() {
|
||||
if [[ $(git diff --name-only ${TRAVIS_COMMIT_RANGE}) = *"docs/"* ]]; then
|
||||
log_info "Checking for changes in docs/ (TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}): changes found"
|
||||
|
Reference in New Issue
Block a user