forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
169 lines (142 loc) · 4.15 KB
/
azure-pipelines.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
schedules:
- cron: "1 0 * * 0"
displayName: Weekly weekend build
branches:
include:
- master
trigger:
- master
pr:
- master
strategy:
matrix:
# testing age of pr
'pr-age':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh pr-age"
skipCache: true
# spelling
'spelling':
image: 'ubuntu-20.04'
cmd: "./.ci/test-spelling-unknown-words.sh"
skipCache: true
# unit tests (openjdk11)
'test':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test"
# unit tests in German locale (openjdk11)
'test-de':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-de"
# unit tests in Spanish locale (openjdk11)
'test-es':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-es"
# unit tests in Finnish locale (openjdk11)
'test-fi':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-fi"
# unit tests in French locale (openjdk11)
'test-fr':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-fr"
# unit tests in Chinese locale (openjdk11)
'test-zh':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-zh"
# unit tests in Japanese locale (openjdk11)
'test-ja':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-ja"
# unit tests in Portuguese locale (openjdk11)
'test-pt':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-pt"
# unit tests in Turkish locale (openjdk11)
'test-tr':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh test-tr"
# OpenJDK11 verify
'OpenJDK11 verify':
image: 'ubuntu-20.04'
cmd: "mvn -e --no-transfer-progress verify"
# MacOS JDK11 verify
'MacOS JDK11 verify':
image: 'macOS-10.15'
cmd: "JAVA_HOME=$JAVA_HOME_11_X64 mvn -e --no-transfer-progress verify"
# MacOS JDK17 verify
'MacOS JDK14 verify':
image: 'macOS-11'
cmd: "JAVA_HOME=$JAVA_HOME_17_X64 mvn -e --no-transfer-progress verify"
# moved back to Travis till we find a way to keep secrets in azure
# ensure that all modules are used in no exception configs
# 'verify-no-exception-configs':
# image: 'ubuntu-20.04'
# cmd: "./.ci/validation.sh verify-no-exception-configs"
# skipCache: true
# needXmlstarlet: true
# versions to update
'versions':
image: 'ubuntu-20.04'
cmd: "./.ci/validation.sh versions"
onCronOnly: true
# lint for .md files, OSX is used because there is problem to install gem on linux
'markdownlint':
image: 'macOS-10.15'
cmd: "./.ci/validation.sh markdownlint"
skipCache: true
needMdl: true
pool:
vmImage: $(image)
variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTS: '--show-version -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
SKIP_CACHE: $(skipCache)
IMAGE: $(image)
ON_CRON_ONLY: $(onCronOnly)
NEED_XMLSTARLET: $(needXmlstarlet)
NEED_MDL: $(needMdl)
BUILD_REASON: $[variables['Build.Reason']]
steps:
- bash: |
apt-fast install -y xmlstarlet
condition: |
and(
ne(variables['Agent.OS'], 'Darwin'),
eq(variables.NEED_XMLSTARLET, 'true')
)
- bash: |
gem install mdl
condition: eq(variables.NEED_MDL, 'true')
- task: JavaToolInstaller@0
inputs:
versionSpec: 11
jdkArchitectureOption: 'X64'
jdkSourceOption: 'PreInstalled'
- task: Cache@2
inputs:
key: 'maven | "$(Agent.OS)" | **/pom.xml'
restoreKeys: |
maven | "$(Agent.OS)"
maven
path: $(MAVEN_CACHE_FOLDER)
displayName: Cache Maven local repo
condition: ne(variables.SKIP_CACHE, 'true')
- bash: |
set -e
echo "ON_CRON_ONLY:"$ON_CRON_ONLY
echo "BUILD_REASON:"$BUILD_REASON
echo "cmd: "$(cmd)
eval "$(cmd)"
condition: |
or (
ne(variables.ON_CRON_ONLY, 'true'),
and(
eq(variables.ON_CRON_ONLY, 'true'),
eq(variables['Build.Reason'], 'Schedule')
)
)