Fakultas Ilmu Komputer UI

.gitlab-ci.yml 710 Bytes
Newer Older
1
image: gradle:6.7-jdk14
saddamonpc's avatar
saddamonpc committed
2
3
4
5
6
7
8
9
10
11

stages:
  - build
  - test

before_script:
  #  - echo `pwd` # debug
  #  - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
  - export GRADLE_USER_HOME=`pwd`/.gradle

12
13
14
variables:
  GRADLE_OPTS: "-Dorg.gradle.daemon=false"
  JACOCO_CSV_LOCATION: '$CI_PROJECT_DIR/build/jacocoCsv'
saddamonpc's avatar
saddamonpc committed
15
16
17
18

build:
  stage: build
  script:
saddamonpc's avatar
saddamonpc committed
19
    - gradle assemble
saddamonpc's avatar
saddamonpc committed
20
21
22
23
24
25
26
27
28
29
  artifacts:
    paths:
      - build/libs/*.jar
    expire_in: 1 week
  only:
    - master

test:
  stage: test
  script:
saddamonpc's avatar
saddamonpc committed
30
    - gradle check
saddamonpc's avatar
saddamonpc committed
31
    - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% covered" }' $JACOCO_CSV_LOCATION