-
-
Notifications
You must be signed in to change notification settings - Fork 969
455 lines (454 loc) Β· 17.7 KB
/
gradle.yml
File metadata and controls
455 lines (454 loc) Β· 17.7 KB
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "CI"
on:
push:
branches:
- '[0-9]+.[0-9]+.x'
pull_request:
workflow_dispatch:
# queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
buildGradle:
name: 'Build Gradle Plugins'
strategy:
fail-fast: false
matrix:
java: [ 17, 21 ]
runs-on: ubuntu-24.04
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π¨ Build project without tests"
if: ${{ contains(github.event.head_commit.message, '[skip tests]') }}
working-directory: 'grails-gradle'
run: >
./gradlew build
--continue
--stacktrace
-PskipCodeStyle
-PskipTests
- name: "π¨ Build project with tests"
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
working-directory: 'grails-gradle'
run: >
./gradlew build
--continue
--stacktrace
--rerun-tasks
-PskipCodeStyle
build:
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
name: 'Build Grails-Core'
strategy:
fail-fast: false
matrix:
java: [ 17, 21, 24 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π¨ Build project"
run: >
./gradlew build :grails-shell-cli:installDist groovydoc
--continue
--rerun-tasks
--stacktrace
-PonlyCoreTests
-PskipCodeStyle
buildForge:
name: "Build Grails Forge"
strategy:
fail-fast: false
matrix:
java: [ 17, 21 ]
runs-on: ubuntu-24.04
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: ${{ matrix.java }}
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π¨ Build project without tests"
if: ${{ contains(github.event.head_commit.message, '[skip tests]') }}
working-directory: 'grails-forge'
run: >
./gradlew build
--continue
--stacktrace
-PskipCodeStyle
-PskipTests
- name: "π¨ Build project with tests"
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
working-directory: 'grails-forge'
run: >
./gradlew build
--continue
--rerun-tasks
--stacktrace
-PskipCodeStyle
- name: "β
Verify combined CLI"
run: |
cd grails-forge
cp grails-cli/build/distributions/apache-grails-*.zip cli.zip
unzip cli -d tmp1
mv tmp1/apache-grails-* tmp1/cli
./tmp1/cli/bin/grails --version
./tmp1/cli/bin/grails-forge-cli --version
- name: "π€ Upload CLI Zip to Workflow Summary Page"
if: ${{ matrix.java == '17' }}
uses: actions/upload-artifact@v4
with:
name: 'apache-grails-SNAPSHOT-bin.zip'
include-hidden-files: true
path: grails-forge/tmp1/cli/**/*
if-no-files-found: 'error'
functional:
name: "Functional Tests"
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
strategy:
fail-fast: false
matrix:
java: [ 17, 21, 24 ]
runs-on: ubuntu-24.04
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π Run Functional Tests"
run: >
./gradlew bootJar check
--continue
--rerun-tasks
--stacktrace
-PgebAtCheckWaiting
-PonlyFunctionalTests
-PskipCodeStyle
-PskipHibernate5Tests
-PskipMongodbTests
mongodbFunctional:
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
name: "Mongodb Functional Tests"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
java: [ 17, 21 ]
mongodb-version: [ '7.0', '8.0' ] # test with supported versions https://www.mongodb.com/legal/support-policy/lifecycles
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout the repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π Run Functional Tests"
env:
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: >
./gradlew bootJar cleanTest check
--continue
--rerun-tasks
--stacktrace
-PonlyMongodbTests
-PmongodbContainerVersion=${{ matrix.mongodb-version }}
-PskipCodeStyle
hibernate5Functional:
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
name: "Hibernate5 Functional Tests"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
java: [ 17, 21 ]
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout the repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π Run Functional Tests"
env:
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: >
./gradlew bootJar cleanTest check
--continue
--rerun-tasks
--stacktrace
-PonlyHibernate5Tests
-PskipCodeStyle
publishGradle:
if: github.repository_owner == 'apache' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
needs: [ buildGradle ]
runs-on: ubuntu-24.04
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π€ Publish Gradle Snapshot Artifacts"
env:
GRAILS_PUBLISH_RELEASE: 'false'
MAVEN_PUBLISH_URL: ${{ secrets.GRAILS_NEXUS_PUBLISH_SNAPSHOT_URL }}
MAVEN_PUBLISH_USERNAME: ${{ secrets.NEXUS_USER }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PW }}
working-directory: 'grails-gradle'
run: >
./gradlew publish aggregateChecksums aggregatePublishedArtifacts
--no-build-cache
--rerun-tasks
- name: "π€ Upload grails-gradle checksums"
uses: actions/upload-artifact@v4
with:
name: grails-gradle-checksums
path: grails-gradle/build/grails-gradle-checksums.txt
- name: "π€ Upload grails-gradle published artifacts"
uses: actions/upload-artifact@v4
with:
name: grails-gradle-artifacts.txt
path: grails-gradle/build/grails-gradle-artifacts.txt
publish:
needs: [ publishGradle, build, functional, hibernate5Functional, mongodbFunctional ]
if: >-
${{ always() &&
github.repository_owner == 'apache' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.publishGradle.result == 'success' &&
(needs.build.result == 'success' || needs.build.result == 'skipped') &&
(needs.functional.result == 'success' || needs.functional.result == 'skipped') &&
(needs.hibernate5Functional.result == 'success' || needs.hibernate5Functional.result == 'skipped') &&
(needs.mongodbFunctional.result == 'success' || needs.mongodbFunctional.result == 'skipped')
}}
runs-on: ubuntu-24.04
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π€ Publish Grails-Core Snapshot Artifacts"
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
env:
GRAILS_PUBLISH_RELEASE: 'false'
MAVEN_PUBLISH_URL: ${{ secrets.GRAILS_NEXUS_PUBLISH_SNAPSHOT_URL }}
MAVEN_PUBLISH_USERNAME: ${{ secrets.NEXUS_USER }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PW }}
with:
timeout_seconds: 1200 # normal range 14min if build is not cached (no tests running)
max_attempts: 3 # Attempts to address: Could not write to resource 'https://repository.apache.org/content/repositories/snapshots/...' Read timed out
retry_wait_seconds: 180
command: ./gradlew publish aggregateChecksums aggregatePublishedArtifacts --no-build-cache --rerun-tasks
- name: "π€ Upload grails-core checksums"
uses: actions/upload-artifact@v4
with:
name: grails-core-checksums.txt
path: build/grails-core-checksums.txt
- name: "π€ Upload grails-core published artifacts"
uses: actions/upload-artifact@v4
with:
name: grails-core-artifacts.txt
path: build/grails-core-artifacts.txt
- name: "π¨ Create Grails Wrapper Distribution Zip"
run: >
./gradlew :grails-wrapper:distZip
- name: "β
Verify grails-wrapper"
if: success()
run: |
export GRAILS_WRAPPER_ALLOWED_TYPES='SNAPSHOT'
cp grails-wrapper/build/distributions/apache-grails-wrapper-*.zip build/wrapper.zip
cd build
unzip wrapper -d tmp
mv tmp/apache-grails-wrapper-* tmp/wrapper
./tmp/wrapper/grailsw --version
- name: "π€ Upload Wrapper Zip to Workflow Summary Page"
uses: actions/upload-artifact@v4
with:
name: apache-grails-wrapper-SNAPSHOT-bin
path: tmp/wrapper
publishForge:
if: github.repository_owner == 'apache' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
needs: [ buildForge, publishGradle, publish ]
runs-on: ubuntu-24.04
steps:
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout repository"
uses: actions/checkout@v4
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π€ Publish Gradle Snapshot Artifacts"
env:
GRAILS_PUBLISH_RELEASE: 'false'
MAVEN_PUBLISH_URL: ${{ secrets.GRAILS_NEXUS_PUBLISH_SNAPSHOT_URL }}
MAVEN_PUBLISH_USERNAME: ${{ secrets.NEXUS_USER }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PW }}
working-directory: 'grails-forge'
run: >
./gradlew publish aggregateChecksums aggregatePublishedArtifacts
--no-build-cache
--rerun-tasks
- name: "π€ Upload grails-forge checksums"
uses: actions/upload-artifact@v4
with:
name: grails-forge-checksums
path: grails-forge/build/grails-forge-checksums.txt
- name: "π€ Upload grails-gradle published artifacts"
uses: actions/upload-artifact@v4
with:
name: grails-forge-artifacts.txt
path: grails-forge/build/grails-forge-artifacts.txt
docs:
if: github.repository_owner == 'apache' && github.event_name == 'push'
needs: [ publish ]
runs-on: ubuntu-24.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@c28619d8999a147d5e09c1199f84ff6af6ad5794
with:
root-reserve-mb: 3072 # Leave ~3 GB on root FS
swap-size-mb: 2048 # Allocate 2 GB swap (default: 4 GB; reduce if not needed)
remove-dotnet: 'true' # Remove .NET SDK (~3-4 GB savings)
remove-android: 'true' # Remove Android tools (~2 GB savings)
remove-haskell: 'true' # Remove Haskell (~1 GB savings)
remove-codeql: 'true' # Remove CodeQL (~500 MB savings)
remove-docker-images: 'false' # Prune Docker if used (~1-2 GB savings)
- name: "Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
run: curl -s https://api.ipify.org
- name: "π₯ Checkout the repository"
uses: actions/checkout@v4
with:
fetch-tags: true
- name: "π Store current branch name"
run: |
TARGET_BRANCH="${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}"
echo "TARGET_BRANCH=${TARGET_BRANCH}" >> $GITHUB_ENV
echo "Target Branch: ${TARGET_BRANCH}"
- name: "π
Set current date as env variable"
run: |
NOW=$(date +'%Y-%m-%dT%H%M%S')
echo "NOW=${NOW}" >> $GITHUB_ENV
echo "Current date: ${NOW}"
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "π¨ Build Snapshot Documentation"
run: >
./gradlew grails-doc:build
-PgithubBranch=${{ env.TARGET_BRANCH }}
- name: "π€ Upload Generated Docs to Workflow Result Page"
uses: actions/upload-artifact@v4
with:
name: grails-docs-${{ env.NOW }}.zip
path: ./build/distributions/*.zip
compression-level: 0 # Already a zip
- name: "π Publish to Github Pages"
if: github.event_name == 'push'
uses: apache/grails-github-actions/deploy-github-pages@asf
env:
GH_TOKEN: ${{ secrets.GRAILS_GHTOKEN }}
GRADLE_PUBLISH_RELEASE: 'false'
SOURCE_FOLDER: grails-doc/build/docs
TARGET_REPOSITORY: 'apache/grails-website'
TARGET_FOLDER: 'docs'
DOCUMENTATION_BRANCH: 'asf-site-production'