playtime/.gitlab-ci.yml

60 lines
1.1 KiB
YAML

image: openjdk:11
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
stages:
- compile
- test
- analyse
- build
before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
- .gradle/wrapper
- .gradle/caches
complie:
stage: compile
script:
- "./gradlew $GRADLE_OPTS testClasses"
unit-test:
stage: test
script:
- "./gradlew $GRADLE_OPTS test"
- "cat build/reports/tests/test/index.html"
artifacts:
expire_in: 3 days
paths:
- build/reports/tests/test/
reports:
junit: build/test-results/test/TEST-*.xml
coverage:
stage: analyse
script:
- "./gradlew $GRADLE_OPTS clean jacocoTestReport"
- "cat build/reports/jacoco/test/html/index.html"
lint:
stage: analyse
script:
- "./gradlew $GRADLE_OPTS --continue ktlintCheck"
- "cat ./build/reports/ktlint/ktlintKotlinScriptCheck.txt"
build-tag-artefact:
stage: build
script:
- "./gradlew $GRADLE_OPTS shadowJar"
artifacts:
paths:
- build/libs/*-all.jar
only:
- tags