scenarium-logger/.gitlab-ci.yml

64 lines
1.6 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"
#JAVA_HOME: "/usr/lib/jvm/java-14-openjdk/"
2020-08-28 17:25:46 +02:00
2020-08-28 19:08:58 +02:00
before_script:
2020-08-28 21:04:11 +02:00
#- apk update && apk add python3 gawk
- which javac
- javac --version
- mvn --version
2020-08-28 19:08:58 +02:00
2020-08-28 17:25:46 +02:00
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-29 13:42:12 +02:00
- mvn $MAVEN_CLI_OPTS checkstyle:checkstyle
2020-08-30 00:01:26 +02:00
- mvn $MAVEN_CLI_OPTS formatter:validate
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 21:04:11 +02:00
#- mkdir -p target/site/cobertura && /usr/bin/python3 ./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 "===============================================\nCoverage Results:\n\n", covered, " / ", instructions, " instructions covered"; print "Total", 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 19:00:34 +02:00
paths:
2020-08-28 18:44:00 +02:00
- target/site/jacoco
2020-08-28 18:58:42 +02:00
reports:
junit: target/surefire-reports/TEST-*.xml
2020-08-28 21:04:11 +02:00
#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 -Dmaven.test.skip=true compile package javadoc:javadoc javadoc:jar
2020-08-28 17:25:46 +02:00
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