diff --git a/.travis.yml b/.travis.yml index 282901a2..6998a39a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,20 +6,31 @@ jdk: # Prevent "mvn install" default step install: true -env: DISPLAY=:99.0 - addons: + sonarcloud: + organization: "echebbi-github" + token: + secure: "YQklJf56eYXw36/OAbJGQ85qNXrYqR1D8MjicMNtg7oB3+lKvCVVaTx+NnS35Gp//TbOuOs7TMyLFENKFxhLBMDbBpDF4FGMOShgCbUpiuep+kkRj5G9c5PRSyjT+Q/UehOI3zmc16RV3RtJQPXDp1mY97gcWCJPonbteteSZCvrvZycJG6BwxrFLNir2rpHgt/SvGGknj9cJKZHwPy7Co838dqVr5fVa9WzElkcEgw5B9rt8o9gkKAdOpO/7JJijyVYuPBDS9DzJ6t7XurVT6nIpufqwVob8xv2uxyyN4icjKA4qcuXIwZBOD00lrhXoIkE7uK8VFEY0WbpMn6HuorqD6NFfpan4hxrrOTr5E19K6OneyaZtums04p9lf0Ev5t7vsx+ai1rZSzhIokZrvd0qZItUPJMRqeZ054kR+TMnkgOv5j77jGOi4bPz71BYB7JQgF8I3S8QcxfFMtgPRBYqHl61+HidNqPb2IfdLAEFG7bPpE+ll12D/CrcYUVtlegcrYX1Fks+KThyK6mbEhYNvNP86GpSBBf807c406XwzYchybdljEPV7Y5wJljdzvx7IksugiTe7SAyibTyFTPqbNxUBvSzT7UcM28y27P81XQEpwVORy2uI6nqtESr0VT3wk8JQAea3fON0HNlXE1+p7mUxY1tJWFIBvlnR8=" apt: packages: + # Required by XVFB - metacity +# Allow UI tests +dist: trusty + before_script: - - sh -e /etc/init.d/xvfb start + # Prepare the environment for UI tests + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 3 # give xvfb some time to start - metacity --sm-disable --replace 2> metacity.err & # Prevent installed packages from being used during build - rm -rfv "$HOME/.m2/repository/org/pitest/" -script: mvn verify -P jacoco +# build.sh is responsible of checking whether Sonar analysis can be run +script: bash .travis/build.sh + after_success: - bash <(curl -s https://codecov.io/bash) @@ -27,4 +38,5 @@ after_success: # Keep p2 information cache: directories: - - "$HOME/.m2/repository" \ No newline at end of file + - "$HOME/.m2/repository" + - "$HOME/.sonar/cache" \ No newline at end of file diff --git a/.travis/build.sh b/.travis/build.sh new file mode 100644 index 00000000..834aac11 --- /dev/null +++ b/.travis/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# IF the variable is set, we can run Sonar analysis. +# Indeed, that means that the build is performed on a branch of the +# pitest/pitclipse repository and that Travis CI allows us to use +# encrypted variables (e.g. Sonar's token) +if [ "${SONAR_SCANNER_HOME}" != "" ]; then + COMMAND="mvn verify -P jacoco sonar:sonar"; + +# ELSE we cannot run Sonar analysis because the branch is coming +# from a fork and Travis CI does not allow use to use encrypted variables. +else + COMMAND="mvn verify -P jacoco"; +fi + +echo ${COMMAND} +${COMMAND} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1d7c993f..9ae356da 100644 --- a/pom.xml +++ b/pom.xml @@ -25,12 +25,27 @@ 1.4.0 0.8.1 + + + Pitclipse + + echebbi-github + https://travis-ci.com/pitest/pitclipse + https://github.com/pitest/pitclipse + https://github.com/pitest/pitclipse/issues + https://sonarcloud.io + 8 + + **/*Exception.java,**/Activator.java + ../../tests/${project.artifactId}.tests/target/jacoco.exec diff --git a/releng/pom.xml b/releng/pom.xml index 2e665541..52409f1a 100644 --- a/releng/pom.xml +++ b/releng/pom.xml @@ -17,4 +17,8 @@ org.pitest.pitclipse.target org.pitest.pitclipse.p2 + + + true + \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..2778d1a8 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,23 @@ +sonar.projectName=Pitclipse +sonar.projectKey=org.pitest:org.pitest.pitclipse + +# ===================================================== +# Meta-data for the project +# ===================================================== + +sonar.links.ci=https://travis-ci.com/pitest/pitclipse +sonar.links.scm=https://github.com/pitest/pitclipse +sonar.links.issue=https://github.com/pitest/pitclipse/issues + + +# ===================================================== +# Properties that will be shared amongst all modules +# ===================================================== + +sonar.host.url=https://sonarcloud.io + +# ===================================================== +# Java config +# ===================================================== + +sonar.java.source=8 \ No newline at end of file diff --git a/tests/io.cucumber/pom.xml b/tests/io.cucumber/pom.xml new file mode 100644 index 00000000..904d0f90 --- /dev/null +++ b/tests/io.cucumber/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + + org.pitest + org.pitest.pitclipse.tests + 2.0.0-SNAPSHOT + + + io.cucumber + eclipse-plugin + 4.3.0 + + + true + + \ No newline at end of file