image: heeroyui/scenarium-gitlabci:latest variables: JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF8" cache: paths: - .m2/repository/ - target/ stages: - style - build - test - package style_job: stage: style script: - java -jar ~/checkstyle.jar -c CheckStyle.xml `find src/ -name "*.java"` - java -jar ~/checkstyle.jar -c CheckStyle.xml `find test/src/ -name "*.java"` build_job: stage: build dependencies: - style_job script: - mvn $MAVEN_CLI_OPTS compile test_job: stage: test dependencies: - build_job script: - mvn $MAVEN_CLI_OPTS test - mkdir -p target/site/cobertura && ./cover2cover.py target/site/jacoco/jacoco.xml src/io/scenarium/logger/ > target/site/cobertura/coverage.xml - awk -F, '{ instructions += $4 + $5; covered += $5 } END { print "===============================================\n== Coverage Results:\n==\n== ", covered, " / ", instructions, " instructions covered"; print "== ", 100*covered/instructions, "% covered\n==\n===============================================" }' target/site/jacoco/jacoco.csv artifacts: when: on_success expire_in: 3 day path: - target/site/jacoco reports: junit: target/surefire-reports/TEST-*.xml cobertura: target/site/cobertura/coverage.xml package_job: stage: package dependencies: - test_job script: - mvn $MAVEN_CLI_OPTS package artifacts: when: on_success expire_in: 3 day paths: - target/*.jar