dcache-cta-build.yaml 1.45 KB
Newer Older
1
2
3
4
stages:
  - build
  - visualize

5
6
7
8
9
10
11
variables:
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
  REPO_NAME: nfs4j

# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
12
13
14
15
  key:
    files:
      - pom.xml
    prefix: "$CI_JOB_NAME"
16
  paths:
17
    - ./.m2/repository
18

19
package:
20
  stage: build
21
  image: maven:3.6.3-openjdk-11
22
  script:
23
24
25
26
27
28
29
30
31
32
    - mvn $MAVEN_CLI_OPTS clean -DskipTests package
  artifacts:
    paths:
      - "target/dcache-cta*.tar.gz"

test:
  stage: build
  image: maven:3.6.3-openjdk-11
  script:
    - mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report
33
34
35
36

  artifacts:
    reports:
      junit:
37
38
        - "target/surefire-reports/TEST-*.xml"
        - "target/failsafe-reports/TEST-*.xml"
39
    paths:
40
      - "target/site/jacoco/jacoco.xml"
41
42
43
44
45
46
47
48
49
50

coverage-jdk11:
  # Must be in a stage later than test-jdk11's stage.
  # The `visualize` stage does not exist by default.
  # Please define it first, or choose an existing stage like `deploy`.
  stage: visualize
  image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
  script:
    # convert report from jacoco to cobertura, using relative project path
    - python /opt/cover2cover.py target/site/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > target/site/cobertura.xml
51
  needs: ["test"]
52
53
54
  artifacts:
    reports:
      cobertura: target/site/cobertura.xml