forked from omegat-org/omegat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
198 lines (192 loc) · 6.04 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
trigger:
branches:
include:
- master
- releases/*
- refs/tags/v*
exclude:
- release/*
- standard
pr:
branches:
include:
- master
- releases/*
exclude:
- standard
paths:
exclude:
- docs
- doc_src
- docs_devel
- README.md
schedules:
- cron: '0 12 * * 6'
displayName: Weekly saturday build
branches:
include:
- master
- releases/*
always: true
variables:
GRADLE_USER_HOME: '$(Pipeline.Workspace)/.gradle'
isRelease: $[contains(variables['Build.SourceBranch'], 'refs/tags/v')]
isReleasesBranch: $[contains(variables['Build.SourceBranch'], 'refs/heads/releases/')]
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
stages:
- stage: TestAndDocCI
condition: and(ne(variables['Build.Reason'], 'Schedule'), ne(variables['Build.Reason'], 'Manual'), ne(variables .isRelease, true))
jobs:
- job: docCheckAndSnapshotRelease
steps:
- checkout: self
clean: true
fetchDepth: 10
fetchTags: true
lfs: false
- bash: |
if [[ "${{ variables['Build.SourceBranch'] }}" == "refs/heads/master" ]]; then
# check latest commit
files=$(git diff-tree --no-commit-id --name-only -r HEAD)
else
# pull-request changes
git fetch origin master
files=$(git diff-tree --no-commit-id --name-only -r origin/master..HEAD)
fi
for file in $files; do
if [[ $file =~ ^doc_src ]]; then
echo "##vso[task.setvariable variable=changeDoc;]True"
exit 0
fi
done
echo "##vso[task.setvariable variable=changeDoc;]False"
name: checkChangeDoc
- template: ci/azure-pipelines/build_doc_steps.yml
parameters:
condition: eq(variables.changeDoc, 'True')
- template: ci/azure-pipelines/publish_manual_snapshot.yml
parameters:
condition: and(eq(variables.changeDoc, 'True'), in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- job: TestOnJava11
displayName: on Java 11
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
fetchDepth: 1
fetchTags: false
- template: ci/azure-pipelines/test_steps.yml
- job: TestOnJava17
displayName: on Java 17
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
fetchDepth: 1
fetchTags: false
- template: ci/azure-pipelines/test_java17_steps.yml
- job: testOnWindows
displayName: on Java 17 on Windows
pool:
vmImage: 'windows-latest'
steps:
- checkout: self
fetchDepth: 2
- template: ci/azure-pipelines/test_java17_steps.yml
- job: testOnMac
displayName: on Java 17 on mac
pool:
vmImage: 'macOS-latest'
steps:
- checkout: self
fetchDepth: 1
fetchTags: false
- template: ci/azure-pipelines/test_java17_steps.yml
# Weekly release steps will be triggerred after integration-test succeeded.
- stage: Weekly
condition: or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual'))
jobs:
- job: CheckForWeekly
displayName: Test and Check
pool:
vmImage: 'ubuntu-22.04'
steps:
- template: ci/azure-pipelines/check_steps.yml
- job: IntegrationTestForWeekly
displayName: Integration Test
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
fetchDepth: 1
fetchTags: false
- template: ci/azure-pipelines/integ_test_steps.yml
parameters:
testType: 'GIT'
duration: 600
- job: WeeklyBuild
displayName: Build for master weekly
dependsOn:
- CheckForWeekly
- IntegrationTestForWeekly
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
fetchDepth: 1
fetchTags: false
- template: ci/azure-pipelines/build_steps.yml
- script: echo "##vso[task.setvariable variable=result;]false"
condition: failed()
- script: |
version=$(./gradlew -qq printVersion | head -n -1 )
echo "##vso[task.setvariable variable=version]$version"
# stop the Gradle daemon to ensure no files are left open (impacting the save cache operation later)
./gradlew --stop
# Check task result
if [[ "$(result)" == "false" ]]; then
exit 1
fi
condition: always()
displayName: Stop Gradle daemon
- template: ci/azure-pipelines/publish_weekly.yml
parameters:
omegatVersion: $(version)
condition: and(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Agent.JobStatus'], 'Succeeded'))
# Release steps will run on the main and/or release branch with tags.
- stage: Release
condition: and(succeeded(), eq(variables.isRelease, true))
jobs:
- job: CheckForRelease
displayName: Test and Check
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
fetchDepth: 2
- template: ci/azure-pipelines/check_steps.yml
- job: ReleaseBuild
pool:
vmImage: 'ubuntu-22.04'
steps:
- checkout: self
fetchDepth: 0
fetchTags: true
- template: ci/azure-pipelines/build_steps.yml
- script: echo "##vso[task.setvariable variable=result;]false"
condition: failed()
- script: |
version=$(./gradlew -qq printVersion | head -n -1 )
echo "##vso[task.setvariable variable=version]$version"
# stop the Gradle daemon to ensure no files are left open (impacting the save cache operation later)
./gradlew --stop
# Check task result
if [[ "$(result)" == "false" ]]; then
exit 1
fi
condition: always()
displayName: Stop Gradle daemon
- template: ci/azure-pipelines/publish_release.yml
parameters:
omegatVersion: $(version)
condition: eq(variables['Agent.JobStatus'], 'Succeeded')