forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
172 lines (144 loc) · 4.25 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
170
171
172
# 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-16.04'
cmd: "./.ci/travis/travis.sh pr-age"
skipCache: true
# spelling
'spelling':
image: 'ubuntu-16.04'
cmd: "./.ci/test-spelling-unknown-words.sh"
skipCache: true
# unit tests (openjdk8)
'test':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test"
# unit tests in German locale (openjdk8)
'test-de':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-de"
# unit tests in Spanish locale (openjdk8)
'test-es':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-es"
# unit tests in Finnish locale (openjdk8)
'test-fi':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-fi"
# unit tests in French locale (openjdk8)
'test-fr':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-fr"
# unit tests in Chinese locale (openjdk8)
'test-zh':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-zh"
# unit tests in Japanese locale (openjdk8)
'test-ja':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-ja"
# unit tests in Portuguese locale (openjdk8)
'test-pt':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-pt"
# unit tests in Turkish locale (openjdk8)
'test-tr':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh test-tr"
# OpenJDK11 verify
'OpenJDK11 verify':
image: 'ubuntu-20.04'
cmd: "mvn -e verify"
# MacOS JDK8 verify
'MacOS JDK8 verify':
image: 'macOS-10.14'
cmd: "export JAVA_HOME=$JAVA_HOME_8_X64 && mvn -e verify"
# MacOS JDK11 verify
'MacOS JDK11 verify':
image: 'macOS-10.14'
cmd: "export JAVA_HOME=$JAVA_HOME_11_X64 && mvn -e verify"
# MacOS JDK13 verify
'MacOS JDK13 verify':
image: 'macOS-10.14'
cmd: "export JAVA_HOME=$JAVA_HOME_13_X64 && mvn -e verify"
# MacOS JDK14 verify
'MacOS JDK14 verify':
image: 'macOS-10.14'
cmd: "export JAVA_HOME=$JAVA_HOME_14_X64 && mvn -e 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-16.04'
# cmd: "./.ci/travis/travis.sh verify-no-exception-configs"
# skipCache: true
# needXmlstarlet: true
# versions to update
'versions':
image: 'ubuntu-16.04'
cmd: "./.ci/travis/travis.sh versions"
onCronOnly: true
# lint for .md files, OSX is used because there is problem to install gem on linux
'markdownlint':
image: 'macOS-10.14'
cmd: "./.ci/travis/travis.sh markdownlint"
skipCache: true
needMdl: true
pool:
vmImage: $(image)
variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTS: '-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: 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
eval "$(cmd)"
condition: |
or (
ne(variables.ON_CRON_ONLY, 'true'),
and(
eq(variables.ON_CRON_ONLY, 'true'),
eq(variables['Build.Reason'], 'Schedule')
)
)