.gitlab-common-ci.yml 1.83 KB
Newer Older
Colin DAMON's avatar
Colin DAMON committed
1
2
3
4
variables:
  MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

Colin DAMON's avatar
Colin DAMON committed
5
6
7
stages:
  - build

Colin DAMON's avatar
Colin DAMON committed
8
9
.java:
  image: maven:3.6.3-jdk-14
Colin DAMON's avatar
Colin DAMON committed
10
  stage: build
Colin DAMON's avatar
Colin DAMON committed
11
  tags:
Colin DAMON's avatar
Colin DAMON committed
12
13
14
15
16
    - docker
  before_script:
    - cd $PROJECT_FOLDER
  script:
    - mvn $MAVEN_CLI_OPTS clean package
Colin DAMON's avatar
Colin DAMON committed
17
    - awk -F"," '{ branches += $4 + $5 + $6 + $7; covered += $5 + $7 } END { print covered, "/", branches, "branches covered"; print 100*covered/branches, "%covered" }' target/site/jacoco/jacoco.csv
Colin DAMON's avatar
Colin DAMON committed
18
19
20
  artifacts:
    reports:
      junit: $PROJECT_FOLDER/target/surefire-reports/TEST-*.xml
21
22
    paths:
      - $PROJECT_FOLDER/target/site/jacoco
Colin DAMON's avatar
Colin DAMON committed
23
    name: "$PROJECT_FOLDER-report"
Colin DAMON's avatar
Colin DAMON committed
24
    expire_in: 1 day
Colin DAMON's avatar
Colin DAMON committed
25
  coverage: "/([^%]+) %covered/"
Colin DAMON's avatar
Colin DAMON committed
26
27
28
29
30
31
32
33
34
35
36
37

.jhipster:
  stage: build
  image: jhipster/jhipster:v6.10.1
  services:
    - docker:19.03.8-dind
  tags:
    - docker
  before_script:
    - cd $PROJECT_FOLDER
  script:
    - ./mvnw -B -Pprod,swagger verify
Colin DAMON's avatar
Colin DAMON committed
38
    - awk -F"," '{ branches += $4 + $5 + $6 + $7; covered += $5 + $7 } END { print covered, "/", branches, "branches covered"; print 100*covered/branches, "%covered" }' target/jacoco-aggregate/jacoco.csv
Colin DAMON's avatar
Colin DAMON committed
39
40
  artifacts:
    reports:
Colin DAMON's avatar
Colin DAMON committed
41
      junit: $PROJECT_FOLDER/target/test-results/**/TEST-*.xml
Colin DAMON's avatar
Colin DAMON committed
42
43
44
45
    paths:
      - $PROJECT_FOLDER/target/jacoco-aggregate
    expire_in: 1 day
  coverage: "/([^%]+) %covered/"
sod-ext's avatar
sod-ext committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

.node:
  image: node
  stage: build
  tags:
    - docker
  before_script:
    - cd $PROJECT_FOLDER
  script:
    - npm i
    - npm test
  coverage: "/Statements.*?(.+)%/"

.node12:
  extends: .node
  image: node:12.19.0

.node14:
  extends: .node
  image: node:14.14.0