scenarium-logger/.gitlab-ci.yml

57 lines
1.5 KiB
YAML
Raw Normal View History

2020-08-28 14:20:18 +02:00
image: heeroyui/scenarium-gitlabci:latest
2020-08-28 17:25:46 +02:00
variables:
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF8"
cache:
paths:
- .m2/repository/
- target/
stages:
- style
2020-08-16 23:24:08 +02:00
- build
- test
2020-08-28 17:25:46 +02:00
- package
2020-08-16 23:43:49 +02:00
style_job:
stage: style
script:
2020-08-28 17:25:46 +02:00
- java -jar ~/checkstyle.jar -c CheckStyle.xml `find src/ -name "*.java"`
- java -jar ~/checkstyle.jar -c CheckStyle.xml `find test/src/ -name "*.java"`
2020-08-16 23:24:08 +02:00
2020-08-16 23:43:49 +02:00
build_job:
2020-08-16 23:24:08 +02:00
stage: build
2020-08-16 23:43:49 +02:00
dependencies:
- style_job
2020-08-16 23:24:08 +02:00
script:
2020-08-28 17:25:46 +02:00
- mvn $MAVEN_CLI_OPTS compile
2020-08-16 23:24:08 +02:00
2020-08-16 23:43:49 +02:00
test_job:
2020-08-16 23:24:08 +02:00
stage: test
2020-08-16 23:43:49 +02:00
dependencies:
- build_job
2020-08-16 23:24:08 +02:00
script:
2020-08-28 17:25:46 +02:00
- mvn $MAVEN_CLI_OPTS test
2020-08-28 18:58:42 +02:00
- mkdir -p target/site/cobertura && ./cover2cover.py target/site/jacoco/jacoco.xml src/io/scenarium/logger/ > target/site/cobertura/coverage.xml
2020-08-28 18:44:00 +02:00
- 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
2020-08-16 23:24:08 +02:00
artifacts:
2020-08-28 18:58:42 +02:00
when: on_success
expire_in: 3 day
2020-08-28 18:44:00 +02:00
path:
- target/site/jacoco
2020-08-28 18:58:42 +02:00
reports:
junit: target/surefire-reports/TEST-*.xml
cobertura: target/site/cobertura/coverage.xml
2020-08-28 17:25:46 +02:00
package_job:
stage: package
dependencies:
- test_job
script:
- mvn $MAVEN_CLI_OPTS package
artifacts:
when: on_success
2020-08-28 18:58:42 +02:00
expire_in: 3 day
2020-08-28 17:25:46 +02:00
paths:
- target/*.jar