-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
138 lines (121 loc) · 3.18 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
workflow:
auto_cancel:
on_new_commit: interruptible
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "schedule"
stages:
- build
- test
- security
- publish
variables:
GRADLE_OPTS: -Dorg.gradle.daemon=false
# ------------------------------ Conditions
.if-merge-request-or-main: &if-merge-request-or-main
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
.if-main: &if-main
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
.if-release: &if-release
- if: '$CI_COMMIT_TAG =~ /^\d+.\d+.\d+.*/'
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
# ------------------------------ Security
security:dependencies:
stage: security
interruptible: true
needs: [ ]
variables:
TRIVY_CACHE_DIR: ".trivycache/"
cache:
paths:
- .trivycache/
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
allow_failure: true
- if: '$CI_COMMIT_TAG =~ /^\d+.\d+.\d+.*/'
allow_failure: false
- if: $CI_PIPELINE_SOURCE == "schedule"
allow_failure: false
artifacts:
when: always
reports:
dependency_scanning: report.json
script:
- trivy repo ./ --exit-code 0
- trivy repo ./ --exit-code 0 --format template --template "@/contrib/gitlab.tpl" --output report.json
- trivy repo ./ --exit-code 1 --severity CRITICAL
tags:
- linux
# ------------------------------ Build
build:
stage: build
interruptible: true
rules:
- *if-merge-request-or-main
before_script:
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
script:
- ./gradlew clean link{LinuxX64,LinuxArm64,AndroidNativeX64,AndroidNativeArm64,AndroidNativeArm32,MingwX64,MacosX64,MacosArm64,IosX64,IosArm64,IosSimulatorArm64} jvmJar --stacktrace
tags:
- macos
# ------------------------------ Tests
test:linux:
stage: test
interruptible: true
rules:
- *if-merge-request-or-main
before_script:
- export JAVA_HOME=/home/sdks/zulu-17
script:
- ./gradlew clean linuxX64Test --stacktrace
tags:
- linux
test:macos:
stage: test
interruptible: true
rules:
- *if-merge-request-or-main
before_script:
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
script:
- ./gradlew clean macosArm64Test --stacktrace
tags:
- macos
test:windows:
stage: test
interruptible: true
rules:
- *if-merge-request-or-main
script:
- ./gradlew clean mingwX64Test --stacktrace
tags:
- windows
# ------------------------------ Publish
publish:artifacts:
stage: publish
rules:
- *if-main
- *if-release
before_script:
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
script:
- ./gradlew clean publish --stacktrace
tags:
- macos
publish:documentation:
stage: publish
rules:
- *if-release
before_script:
- export JAVA_HOME=/home/sdks/zulu-17
script:
- ./gradlew -DpublishDocs.root=/var/www/docs/filament publishDocs --stacktrace
tags:
- linux