forked from hoijui/JavaOSC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
33 lines (29 loc) · 904 Bytes
/
Copy path.travis.yml
File metadata and controls
33 lines (29 loc) · 904 Bytes
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
language: java
sudo: false # faster builds
addons:
sonarcloud:
organization: "hoijui-github"
token: ${SONAR_TOKEN}
jdk:
# Only test one JDK to save energy
# - oraclejdk8
# - oraclejdk11
- openjdk8
# - openjdk11
script:
# NOTE JaCoCo is used to have code coverage, the agent has to be activated
# NOTE The SonarCube Community Edition (free plan) only allows branch "master".
# NOTE We only run the SonarQube stuff for the root repo,
# as others (forks) will likely not have a SONAR_TOKEN specified
# in the travis settings.
- |
mvnExtra=""
if [ $TRAVIS_BRANCH = "master" ] && [ "$TRAVIS_REPO_SLUG" = "hoijui/JavaOSC" ]
then
mvnExtra="sonar:sonar -Psonar -Dsonar.projectKey=hoijui_JavaOSC"
fi
mvn -B clean org.jacoco:jacoco-maven-plugin:prepare-agent package $mvnExtra
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'