Fakultas Ilmu Komputer UI

Commit cb2edb34 authored by hazlazuardi's avatar hazlazuardi
Browse files

Setting up Gradle and YML file for unit testing

parent 1018935a
Pipeline #81526 passed with stages
in 3 minutes and 28 seconds
image: java:latest
stages:
- build
- execute
- test
default:
image: gradle:6.8.3-jdk15
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
JACOCO_CSV_LOCATION: '$CI_PROJECT_DIR/build/jacocoCsv'
build:
stage: build
script: /usr/lib/jvm/java-8-openjdk-amd64/bin/javac Main.java
script:
- gradle assemble
test:
stage: test
script:
- gradle check
- gradle jacocoTestReport
- gradle jacocoTestCoverageVerification
- awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' $JACOCO_CSV_LOCATION
artifacts:
paths:
- Main.*
execute:
stage: execute
script: /usr/lib/jvm/java-8-openjdk-amd64/bin/java Main
- build/jacoco/test.exec
\ No newline at end of file
#Sun Jun 06 09:26:36 WIB 2021
gradle.version=6.8
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment