-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
69 lines (60 loc) · 1.42 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
stages:
- build
- lint
- test
- danger
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image: gradle:8.4.0-jdk17-jammy
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- .gradle
- build
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
build:
stage: build
script:
- gradle build -x test
test:
stage: test
script:
- gradle test
- cat build/jacoco/test/html/index.html | grep -o 'Total[^%]*%'
coverage: '/Total.*?([0-9]{1,3})%/'
artifacts:
when: always
paths:
- build/test-results/test/**/TEST-*.xml
- build/jacoco/test/jacocoTestReport.xml
expire_in: 30 days
reports:
junit: build/test-results/test/**/TEST-*.xml
danger:
stage: danger
image: node:18
only:
- merge_requests
script:
- git clone https://gitlab.com/platinum-open-source/flowops/danger-bot danger-bot
- cd danger-bot
- npm install
- npx danger ci
terraform-lint:
stage: lint
script:
- chmod +x ./ci/scripts/install_tf
- ./ci/scripts/install_tf
- chmod +x ./ci/scripts/validate_tf_files
- ./ci/scripts/validate_tf_files
- terraform fmt -check=true -recursive
scala-lint:
stage: lint
script:
- chmod +x ./ci/scripts/install_coursier_and_scalafmt
- ./ci/scripts/install_coursier_and_scalafmt
- ~/.local/share/coursier/bin/scalafmt --test