blob: ce3e079136a79144da49a91a3006e41d1b946e78 [file] [log] [blame]
language: java
sudo: false
cache:
apt: true
directories:
- ~/.m2
addons:
apt:
packages:
- xsltproc
- xmlstarlet
- oracle-java8-installer
branches:
only:
- master
install:
-
matrix:
fast_finish: true
include:
# testing of PR format
- env:
- DESC="test Issue ref in PR description"
- CMD="./.ci/travis/travis.sh pr-description"
- SKIP_CI="false"
# unit tests (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests and deploy"
- CMD="mvn -e clean integration-test failsafe:verify -DargLine='-Xms1024m -Xmx2048m'"
- DEPLOY="true"
# checkstyle (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="checkstyle and sevntu-checkstyle"
- CMD="./.ci/travis/travis.sh checkstyle-and-sevntu"
# jacoco and codecov (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="jacoco and codecov"
- CMD="./.ci/travis/travis.sh jacoco"
- CMD_AFTER_SUCCESS="bash <(curl -s https://codecov.io/bash)"
# spotbugs and pmd (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="spotbugs,pmd"
- CMD="export MAVEN_OPTS='-Xmx2000m' && mvn -e clean compile pmd:check spotbugs:check"
# eclipse static analysis
- jdk: oraclejdk8
env:
- DESC="eclipse static analysis"
- CMD="mvn -e clean compile exec:exec -Peclipse-compiler"
# Releasenotes generation - validation
- jdk: oraclejdk8
env:
- DESC="Releasenotes generation"
- CMD="./.ci/travis/travis.sh releasenotes-gen"
# NonDex (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NonDex"
- CMD="./.ci/travis/travis.sh nondex"
# site
- jdk: oraclejdk8
env:
- DESC="site without validations"
- CMD="./.ci/travis/travis.sh site"
# unit tests in German locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests de"
- CMD="./.ci/travis/travis.sh test-de"
# unit tests in Spanish locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests es"
- CMD="./.ci/travis/travis.sh test-es"
# unit tests in Finnish locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests fi"
- CMD="./.ci/travis/travis.sh test-fi"
# unit tests in French locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests fr"
- CMD="./.ci/travis/travis.sh test-fr"
# unit tests in Chinese locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests zh"
- CMD="./.ci/travis/travis.sh test-zh"
# unit tests in Japanese locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests ja"
- CMD="./.ci/travis/travis.sh test-jp"
# unit tests in Portuguese locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests pt"
- CMD="./.ci/travis/travis.sh test-pt"
# unit tests in Turkish locale (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="tests tr"
- CMD="./.ci/travis/travis.sh test-tr"
# assembly (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="assembly & run '-all' jar"
- CMD="./.ci/travis/travis.sh assembly-run-all-jar"
# NoExceptiontest - Guava with google_checks (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="NoExceptionTest - Guava with google_checks"
- CMD="./.ci/travis/travis.sh no-exception-test-guava-with-google-checks"
# release dry run (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="release dry run"
- CMD="./.ci/travis/travis.sh release-dry-run"
# Check the chmod on files.
- env:
- DESC="check permissions on all files"
- CMD="./.ci/travis/travis.sh check-chmod"
- SKIP_CI="false"
# Ensure that all Sevntu check are kused
- jdk: oraclejdk8
env:
- DESC="All sevntu checks should be used"
- CMD="./.ci/travis/travis.sh all-sevntu-checks"
# MacOS verify (till cache is not working, we can not do verify)
- os: osx
osx_image: xcode9.3
env:
- DESC="MacOS verify, site, assembly
- CMD1="mvn -e package -Dlinkcheck.skip=true"
- CMD2="mvn -e package -Passembly"
- CMD="export JAVA_HOME=$(/usr/libexec/java_home) && $CMD1 && $CMD2"
# https://sonarcloud.io (oraclejdk8)
- jdk: oraclejdk8
env:
- DESC="sonarcloud.io"
- CMD="./.ci/travis/travis.sh sonarqube"
# No error testing - simple-binary-encoding
- jdk: oraclejdk8
env:
- DESC="no error test on simple-binary-encoding"
- CMD="./.ci/travis/travis.sh no-error-test-sbe"
# versions to update
- jdk: oraclejdk8
env:
- DESC="print versions to update"
- CMD="./.ci/travis/travis.sh versions"
- SKIP_CI="false"
# OpenJDK8 build
- jdk: openjdk8
env:
- DESC="build with OpenJDK8"
- CMD="mvn -e package -Passembly && mvn -e site -Dlinkcheck.skip=true"
# OracleJDK9 build
- jdk: oraclejdk9
env:
- DESC="build with OracleJDK9"
- CMD="mvn -e package -Passembly && mvn -e site -Dlinkcheck.skip=true"
# OracleJDK9 compile input files with jdk9 specific syntax
- jdk: oraclejdk9
env:
- DESC="compile input files with jdk9 specific syntax"
- CMD="./.ci/travis/travis.sh javac9"
# compile input files compilation that are not compiled by eclipse
- jdk: oraclejdk8
env:
- DESC="compile input files that are not compiled by eclipse"
- CMD="./.ci/travis/travis.sh javac8"
# new questionably spelled words
- env:
- DESC="spell checker"
- CMD="./.ci/test-spelling-unknown-words.sh"
- SKIP_CI="false"
script:
- SKIP_FILES1=".github|codeship-*|buddy.yml|appveyor.yml|circleci|distelli-manifest.yml"
- SKIP_FILES2="|fast-forward-merge.sh|LICENSE|LICENSE.apache20|README.md|release.sh|RIGHTS.antlr"
- SKIP_FILES3="|shippable.yml|shippable.sh|wercker.yml|wercker.sh|intellij-idea-inspections.xml"
- SKIP_FILES4="|Jenkinsfile"
- SKIP_FILES=$SKIP_FILES1$SKIP_FILES2$SKIP_FILES3$SKIP_FILES4
- |
if [[ $SKIP_CI != 'false' ]]; then
if [[ $(git diff --name-only HEAD HEAD~1 | grep -vE "$SKIP_FILES" \
| cat | wc -c | sed 's/^ *//' ) > 0 ]]; then
SKIP_CI="false"
else
SKIP_CI="true"
fi
fi
- echo "SKIP_CI="$SKIP_CI
- |
set -e
if [[ $SKIP_CI == 'false' ]];
then
eval $CMD;
echo "eval of CMD is completed"
else
echo "CI is skipped"
fi
after_success:
- |
set -e
if [[ -n $CMD_AFTER_SUCCESS
&& $SKIP_CI == 'false'
]];
then
eval $CMD_AFTER_SUCCESS;
echo "CMD_AFTER_SUCCESS is finished";
fi
- |
set -e
SKIP_DEPLOY=false
if [ $(git log -1 | grep -E "\[maven-release-plugin\] prepare release" | cat | wc -l) -lt 1 ];
then
SKIP_DEPLOY=false;
else
SKIP_DEPLOY=true;
fi;
if [[ $TRAVIS_REPO_SLUG == 'checkstyle/checkstyle'
&& $TRAVIS_BRANCH == 'master'
&& $TRAVIS_PULL_REQUEST == 'false'
&& $DEPLOY == 'true'
&& $SKIP_CI == 'false'
&& $SKIP_DEPLOY == 'false'
]];
then
mvn -e -s config/deploy-settings.xml -Pno-validations deploy;
echo "deploy to maven snapshot repository is finished";
fi