scenarium-logger/.gitlab-ci.yml

64 lines
1.6 KiB
YAML

image: heeroyui/scenarium-gitlabci:latest
variables:
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF8"
#JAVA_HOME: "/usr/lib/jvm/java-14-openjdk/"
before_script:
#- apk update && apk add python3 gawk
- which javac
- javac --version
- mvn --version
cache:
paths:
- .m2/repository/
- target/
stages:
- style
- build
- test
- package
style_job:
stage: style
script:
- mvn $MAVEN_CLI_OPTS checkstyle:checkstyle
- mvn $MAVEN_CLI_OPTS formatter:validate
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 && /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
artifacts:
when: on_success
expire_in: 3 day
paths:
- 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 -Dmaven.test.skip=true compile package javadoc:javadoc javadoc:jar
artifacts:
when: on_success
expire_in: 3 day
paths:
- target/*.jar