Skip to content

Run an aggregate on the right of a data service @Where comparison as a subquery #15364

Run an aggregate on the right of a data service @Where comparison as a subquery

Run an aggregate on the right of a data service @Where comparison as a subquery #15364

Workflow file for this run

# 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:
# ready_for_review is not a default type: a draft runs nothing until it is ready or labelled "run ci".
types: [ opened, synchronize, reopened, ready_for_review ]
workflow_dispatch:
inputs:
run-tests:
description: "Run the test jobs where the branch rule would skip them (a release branch below the default); a [skip tests] head commit still skips them"
type: boolean
default: false
# A new commit on the same pull request or branch cancels the build and test jobs of the run in flight: their
# results would be for a superseded commit, and the run that replaces it publishes the newer one. The publish
# jobs (publishGradle, publish, publishForge, verifyWrapper, docs) run on always() with explicit result checks
# instead, so a publish that has started completes: an interrupted upload would leave the snapshot repository
# with modules from two commits. publishGradle waits for every build job (buildGradle, buildForge and
# validateDependencies), so nothing of the cancelled commit is published when the cancel arrives before the
# builds have finished. A later cancel lets the publish jobs whose needs have already succeeded or been skipped
# run: on a run without tests that is the whole chain, and on a run whose tests are still running only
# publishGradle, because a cancelled test job fails the explicit checks of publish and of everything after it.
# A cancel after every test has passed lets the whole chain run as well. The replacing run is pending until the
# cancelled run has finished every job, so two publishes of the same branch never overlap, and it then publishes
# the newer commit over whatever the cancelled run published. A normal cancel does not stop a running always()
# job either; the CI policy section of AGENTS.md says how to force one.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
policy:
name: "CI policy"
# A pull request labelled "no ci", or a draft without the "run ci" label, skips this job; every other
# job needs it, so nothing runs for such a pull request.
if: >-
github.event_name != 'pull_request'
|| (!contains(github.event.pull_request.labels.*.name, 'no ci')
&& (!github.event.pull_request.draft || contains(github.event.pull_request.labels.*.name, 'run ci')))
uses: ./.github/workflows/ci-policy.yml
validateDependencies:
name: 'Validate Dependency Versions'
needs: [ policy ]
runs-on: ubuntu-22.04
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Validate grails-core dependency versions"
run: >
./gradlew validateDependencyVersions
--continue
--stacktrace
- name: "🔍 Validate grails-core production classpath"
run: >
./gradlew validateProductionClasspath
--continue
--stacktrace
- name: "🔍 Validate grails-gradle dependency versions"
working-directory: 'grails-gradle'
run: >
./gradlew validateDependencyVersions
--continue
--stacktrace
validateBomProperties:
name: 'Validate BOM Properties'
needs: [ policy ]
runs-on: ubuntu-24.04
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Validate grails-core BOM properties"
run: >
./gradlew validateBomProperties
--continue
--stacktrace
- name: "🔍 Validate grails-gradle BOM properties"
working-directory: 'grails-gradle'
run: >
./gradlew validateBomProperties
--continue
--stacktrace
validateGithubBranch:
name: 'Validate githubBranch'
needs: [ policy ]
runs-on: ubuntu-24.04
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v7.0.1
- name: "🔍 Verify githubBranch names the maintenance branch"
# The documentation links every page to its source on githubBranch, and a release fails unless githubBranch names
# the branch it targets, so a maintenance branch must set it to itself from the moment it is created. A pull
# request is checked against the branch it merges into. GitHub expressions have no regular expressions, so the
# step skips any branch that is not named X.Y.x.
env:
BRANCH: ${{ github.base_ref || github.ref_name }}
run: |
if [[ ! "${BRANCH}" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then
echo "Skipping, ${BRANCH} is not a maintenance branch"
exit 0
fi
githubBranch=$(sed -n 's/^githubBranch=//p' gradle.properties)
if [[ "${githubBranch}" != "${BRANCH}" ]]; then
echo "❌ githubBranch in gradle.properties is '${githubBranch}', not ${BRANCH}." >&2
exit 1
fi
echo "✅ gradle.properties sets githubBranch=${BRANCH}"
buildGradle:
name: 'Build Gradle Plugins'
needs: [ policy ]
strategy:
fail-fast: false
matrix:
java: [ 21, 25 ]
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🔨 Build project without tests"
if: ${{ needs.policy.outputs.run-tests != 'true' }}
working-directory: 'grails-gradle'
run: >
./gradlew build
--continue
--stacktrace
-PskipCodeStyle
-PskipTests
- name: "🔨 Build project with tests"
if: ${{ needs.policy.outputs.run-tests == 'true' }}
working-directory: 'grails-gradle'
run: >
./gradlew build
--continue
--stacktrace
--rerun-tasks
-PskipCodeStyle
buildLogic:
# The build logic is an included build: the root build uses its plugins but never runs its tests
name: 'Build Logic'
needs: [ policy ]
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🔨 Build and test the build logic"
if: ${{ needs.policy.outputs.run-tests == 'true' }}
working-directory: 'build-logic'
run: >
./gradlew check
--continue
--stacktrace
build:
name: 'Build Grails-Core (${{ matrix.job_name }})'
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
java: 21
job_name: Ubuntu JDK 21
cache_writer: true
gradle_task: 'build :grails-shell-cli:installDist groovydoc'
- os: ubuntu-22.04
java: 25
job_name: Ubuntu JDK 25
gradle_task: 'build :grails-shell-cli:installDist groovydoc'
- os: macos-latest
java: 21
job_name: macOS JDK 21
cache_writer: true
gradle_task: 'build :grails-shell-cli:installDist groovydoc'
# The macOS runner has ~7 GB of RAM and 3 CPUs, against ~16 GB and 4 CPUs on the
# Linux and Windows runners, so it has the least room for concurrent JVMs.
# Capping only maxTestParallel would not help: that is a per-Test-task limit, and
# with org.gradle.parallel=true several projects' test tasks run at once, so the
# number of live forks is bounded by Gradle's global worker pool - which defaults
# to the 3 CPUs here. --max-workers is therefore the setting that actually limits
# concurrent test, compiler and groovydoc JVMs; maxTestParallel is kept alongside
# it so no single task exceeds that cap either.
runner_arguments: '--max-workers=2 -PmaxTestParallel=2'
- os: windows-latest
java: 25
job_name: Windows JDK 25 shard 0
cache_writer: true
gradle_task: 'build :grails-shell-cli:installDist groovydoc'
shard_arguments: '-PtestShardCount=3 -PtestShardIndex=0'
- os: windows-latest
java: 25
job_name: Windows JDK 25 shard 1
gradle_task: testShard
shard_arguments: '-PtestShardCount=3 -PtestShardIndex=1'
- os: windows-latest
java: 25
job_name: Windows JDK 25 shard 2
gradle_task: testShard
shard_arguments: '-PtestShardCount=3 -PtestShardIndex=2'
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
with:
cache-writer: ${{ matrix.cache_writer }}
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🔨 Build project"
# build-logic is an included build, so the specs of its vulnerability-scan plugin are run through the root build.
run: >
./gradlew ${{ matrix.gradle_task }} :build-logic-root:vulnerability-scan:check
--continue
--stacktrace
-PonlyCoreTests
-PskipCodeStyle
${{ matrix.shard_arguments }}
${{ matrix.runner_arguments }}
buildRerunTasks:
name: 'Build Grails-Core Rerunning all Tasks (${{ matrix.job_name }})'
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
java: 21
job_name: Ubuntu JDK 21 build
gradle_task: 'build :grails-shell-cli:installDist groovydoc'
extra_arguments: '-PskipTests'
- os: ubuntu-22.04
java: 21
job_name: Ubuntu JDK 21 shard 0
gradle_task: testShard
extra_arguments: '-PtestShardCount=3 -PtestShardIndex=0'
- os: ubuntu-22.04
java: 21
job_name: Ubuntu JDK 21 shard 1
gradle_task: testShard
extra_arguments: '-PtestShardCount=3 -PtestShardIndex=1'
- os: ubuntu-22.04
java: 21
job_name: Ubuntu JDK 21 shard 2
gradle_task: testShard
extra_arguments: '-PtestShardCount=3 -PtestShardIndex=2'
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🔨 Build project"
run: >
./gradlew ${{ matrix.gradle_task }} :build-logic-root:vulnerability-scan:check
--continue
--rerun-tasks
--stacktrace
-PonlyCoreTests
-PskipCodeStyle
${{ matrix.extra_arguments }}
buildForge:
name: "Build Grails Forge (Java ${{ matrix.java }}, indy=${{ matrix.indy }})"
needs: [ policy ]
strategy:
fail-fast: false
matrix:
java: [ 21, 25 ]
indy: [ false ]
include:
- java: 21
indy: true
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: 'liberica'
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🔨 Build project without tests"
if: ${{ needs.policy.outputs.run-tests != 'true' }}
working-directory: 'grails-forge'
run: >
./gradlew build
--continue
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-PskipCodeStyle
-PskipTests
- name: "🔨 Build project with tests"
if: ${{ needs.policy.outputs.run-tests == 'true' }}
working-directory: 'grails-forge'
run: >
./gradlew build
--continue
--rerun-tasks
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-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 == '21' && matrix.indy == false }}
uses: actions/upload-artifact@v7.0.1
with:
name: 'apache-grails-SNAPSHOT-bin.zip'
include-hidden-files: true
path: grails-forge/tmp1/cli/**/*
if-no-files-found: 'error'
# Every test job from here through neo4jFunctional sets timeout-minutes to twice the slowest run that
# finished on its own, passed or failed, over the 160 CI runs of 2026-09-03 to 2026-09-13, rounded up to
# the half hour. Without a limit, a test JVM that never exits holds its job for GitHub's six-hour default.
functional:
name: "Functional Tests (${{ matrix.job_name }})"
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
timeout-minutes: 150 # slowest run: 63 min
strategy:
fail-fast: false
matrix:
include:
- java: 21
indy: false
job_name: Java 21, indy=false
gradle_task: 'bootJar check'
artifact_suffix: java21-indyfalse-shard0
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=0'
- java: 21
indy: false
job_name: Java 21, indy=false, shard 1
gradle_task: testShard
artifact_suffix: java21-indyfalse-shard1
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=1'
- java: 21
indy: true
job_name: Java 21, indy=true
gradle_task: 'bootJar check'
artifact_suffix: java21-indytrue-shard0
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=0'
- java: 21
indy: true
job_name: Java 21, indy=true, shard 1
gradle_task: testShard
artifact_suffix: java21-indytrue-shard1
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=1'
- java: 25
indy: false
job_name: Java 25, indy=false
gradle_task: 'bootJar check'
artifact_suffix: java25-indyfalse-shard0
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=0'
- java: 25
indy: false
job_name: Java 25, indy=false, shard 1
gradle_task: testShard
artifact_suffix: java25-indyfalse-shard1
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=1'
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🏃 Run Functional Tests"
run: >
./gradlew ${{ matrix.gradle_task }}
--continue
--rerun-tasks
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-PonlyFunctionalTests
-PskipCodeStyle
-PskipHibernate5Tests
-PskipHibernate7Tests
-PskipMongodbTests
-PskipNeo4jTests
-PskipSpringSecurityTests
-PskipRedisTests
${{ matrix.shard_arguments }}
- name: "📤 Upload Geb Reports"
if: failure()
uses: actions/upload-artifact@v7.0.1
with:
name: geb-reports-functional-${{ matrix.artifact_suffix }}
path: '**/build/geb-reports/'
if-no-files-found: ignore
security:
name: "Spring Security Tests (${{ matrix.job_name }})"
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
timeout-minutes: 150 # slowest run: 71 min
strategy:
fail-fast: false
matrix:
include:
- java: 21
job_name: Java 21
gradle_task: 'bootJar check'
- java: 25
job_name: Java 25
gradle_task: 'bootJar check'
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=0'
- java: 25
job_name: Java 25, shard 1
gradle_task: testShard
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=1'
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🏃 Run Functional Tests"
run: >
./gradlew ${{ matrix.gradle_task }}
--continue
--rerun-tasks
--stacktrace
-PonlySpringSecurityTests
-PskipCodeStyle
${{ matrix.shard_arguments }}
securityConfig:
name: "Spring Security Config Functional Tests"
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
timeout-minutes: 90 # slowest run: 39 min
strategy:
fail-fast: false
matrix:
# Each value boots the core functional-test-app with a different Spring Security configuration.
# The specs are gated with @IgnoreIf({ System.getProperty('TESTCONFIG') != '<config>' }), so a
# config only runs when TESTCONFIG matches. TESTCONFIG is applied at app startup, so every config
# must be its own run. Carried over from the standalone grails-spring-security CI — do not drop
# configs (add, don't remove) when the app's security configurations change.
test-config: [ 'static', 'annotation', 'requestmap', 'basic', 'basicCacheUsers', 'misc', 'putWithParams', 'bcrypt', 'issue503', 'noAnonymous', 'oncePerRequest', 'inactive' ]
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🏃 Run Spring Security Functional Tests (TESTCONFIG=${{ matrix.test-config }})"
run: >
./gradlew
:grails-test-examples-spring-security-core-functional-test-app:check
--continue
--rerun-tasks
--stacktrace
-DTESTCONFIG=${{ matrix.test-config }}
-PskipCodeStyle
casSecurityConfig:
name: "Spring Security CAS Functional Tests"
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
timeout-minutes: 90 # slowest run: 35 min
strategy:
fail-fast: false
matrix:
# The CAS test app authenticates against a real Apereo CAS server started via Testcontainers.
# 'cas' leaves the proxy settings unset; 'casProxy' exercises the proxy-granting-ticket
# callback; 'casNoSingleSignout' asserts the shipped default, where single signout is off.
# TESTCONFIG is applied at app startup, so every config must be its own run. The specs are
# gated on a config being selected, so the broad 'security' job skips them and no config is
# run twice.
# Carried over from the standalone grails-spring-security CI convention - add, don't remove.
test-config: [ 'cas', 'casProxy', 'casNoSingleSignout' ]
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🏃 Run Spring Security CAS Functional Tests (TESTCONFIG=${{ matrix.test-config }})"
run: >
./gradlew
:grails-test-examples-spring-security-cas-test1:check
--continue
--rerun-tasks
--stacktrace
-DTESTCONFIG=${{ matrix.test-config }}
-PskipCodeStyle
redis:
name: "Redis Tests"
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
timeout-minutes: 180 # slowest run: 86 min
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java: [ 21, 25 ]
redis-version: [ '7.4', '8.0' ] # Redis container version exercised via Testcontainers
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "🏃 Run Redis Tests"
run: >
./gradlew bootJar check
--continue
--rerun-tasks
--stacktrace
-PonlyRedisTests
-PredisContainerVersion=${{ matrix.redis-version }}
-PskipCodeStyle
mongodbFunctional:
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
name: "Mongodb Functional Tests (Java ${{ matrix.java }}, MongoDB ${{ matrix.mongodb-version }}, indy=${{ matrix.indy }})"
timeout-minutes: 150 # slowest run: 70 min
# ubuntu-22.04 while https://github.com/actions/runner-images/issues/15005 is open: the ubuntu-24.04 image 20261018.339
# and the ubuntu-26.04 image ship kernel 7.0.0-1017-azure, which MongoDB 8.0 reads as 7.0.0 and refuses to start on (it
# exits on 6.19.0 through 7.0.13), so every mongo:8.0 container of the MongoDB 8.0 lane dies before "waiting for
# connections". The ubuntu-22.04 image runs kernel 6.8. The embedded server the 8.0 and 9.0 lanes start for their
# replica-set specifications, flapdoodle's V8_0 and V8_3 (8.0.23 and 8.3.2), predates even the exemption for 7.0.14
# and newer (SERVER-125742: 8.0.30 and 8.3.9) and exits on any kernel from 6.19.0 up, so moving back needs both a
# mongo:8.0 image with the fix (SERVER-131779: 8.0.35 was never released, so 8.0.36 or newer) and a flapdoodle
# release whose lines have it.
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java: [ 21, 25 ]
mongodb-version: [ '7.0', '8.0', '9.0' ] # test with supported versions https://www.mongodb.com/legal/support-policy/lifecycles
indy: [ false ]
exclude:
# 7.0 is the oldest supported line and the one closest to its end of life: one JDK is enough for it, and
# 8.0 and 9.0 cover Java 25.
- java: 25
mongodb-version: '7.0'
include:
- java: 21
mongodb-version: '7.0'
indy: true
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Restore the mongod the embedded server runs"
id: embedmongo-cache
uses: actions/cache/restore@v6.1.0
with:
# Outside the Gradle User Home that setup-gradle caches: this holds an immutable download from
# fastdl.mongodb.org - the archive and the binary extracted out of it - and no database,
# so it belongs to no branch and does not change when a dependency version does.
# Keyed by the version this entry asks for, because the matrix runs more than one and a
# single key would keep whichever job missed first and leave the other restoring 250MB
# of a binary it cannot use. No restore-keys, for that same reason.
path: ~/.embedmongo
key: embedmongo-${{ runner.os }}-${{ matrix.mongodb-version }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🏃 Run Functional Tests"
env:
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: >
./gradlew bootJar check
--continue
--rerun-tasks
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-PonlyMongodbTests
-PmongodbContainerVersion=${{ matrix.mongodb-version }}
-PskipCodeStyle
- name: "🗄️ Save the mongod the embedded server runs"
# The download is the same on every branch, and every branch can restore the default branch's entries,
# so only a push to the default branch saves it; other branches and pull requests only restore it.
if: ${{ success() && github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.embedmongo-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6.1.0
with:
path: ~/.embedmongo
key: ${{ steps.embedmongo-cache.outputs.cache-primary-key }}
hibernate5Functional:
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
name: "Hibernate5 Functional Tests (Java ${{ matrix.java }}, indy=${{ matrix.indy }})"
timeout-minutes: 120 # slowest run: 58 min
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
java: [ 21, 25 ]
indy: [ false ]
include:
- java: 21
indy: true
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🏃 Run Functional Tests"
env:
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: >
./gradlew bootJar check
--continue
--rerun-tasks
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-PonlyHibernate5Tests
-PskipCodeStyle
hibernate7Functional:
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
name: "Hibernate7 Functional Tests (${{ matrix.job_name }})"
timeout-minutes: 210 # slowest run: 104 min, which failed; the slowest that passed took 86
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- java: 21
indy: false
job_name: Java 21, indy=false
gradle_task: 'bootJar check'
shard_arguments: '-PtestShardCount=3 -PtestShardIndex=0'
- java: 21
indy: false
job_name: Java 21, indy=false, shard 1
gradle_task: testShard
shard_arguments: '-PtestShardCount=3 -PtestShardIndex=1'
- java: 21
indy: false
job_name: Java 21, indy=false, shard 2
gradle_task: testShard
shard_arguments: '-PtestShardCount=3 -PtestShardIndex=2'
- java: 21
indy: true
job_name: Java 21, indy=true
gradle_task: 'bootJar check'
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=0'
- java: 21
indy: true
job_name: Java 21, indy=true, shard 1
gradle_task: testShard
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=1'
- java: 25
indy: false
job_name: Java 25, indy=false
gradle_task: 'bootJar check'
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=0'
- java: 25
indy: false
job_name: Java 25, indy=false, shard 1
gradle_task: testShard
shard_arguments: '-PtestShardCount=2 -PtestShardIndex=1'
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🏃 Run Functional Tests"
env:
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: >
./gradlew ${{ matrix.gradle_task }}
--continue
--rerun-tasks
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-PonlyHibernate7Tests
-PskipCodeStyle
${{ matrix.shard_arguments }}
neo4jFunctional:
needs: [ policy ]
if: ${{ needs.policy.outputs.run-tests == 'true' }}
name: "Neo4j Functional Tests (Java ${{ matrix.java }}, indy=${{ matrix.indy }})"
timeout-minutes: 180 # slowest run: 90 min
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
java: [ 21, 25 ]
indy: [ false ]
include:
- java: 21
indy: true
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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🏃 Run Functional Tests"
env:
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: >
./gradlew bootJar check
--continue
--rerun-tasks
--stacktrace
-PgrailsIndy=${{ matrix.indy }}
-PonlyNeo4jTests
-PskipCodeStyle
publishGradle:
# always() with explicit result checks, see the concurrency comment at the top. It waits for every build job,
# not only buildGradle, so that a run cancelled before its builds have finished publishes nothing, and a
# commit whose Forge build or dependency validation failed is not published.
if: >-
${{ always() &&
github.repository_owner == 'apache' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.buildGradle.result == 'success' &&
needs.buildForge.result == 'success' &&
needs.validateDependencies.result == 'success'
}}
needs: [ buildGradle, buildForge, validateDependencies ]
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- 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@v7.0.1
with:
name: grails-gradle-checksums
path: grails-gradle/build/grails-gradle-checksums.txt
- name: "📤 Upload grails-gradle published artifacts"
uses: actions/upload-artifact@v7.0.1
with:
name: grails-gradle-artifacts.txt
path: grails-gradle/build/grails-gradle-artifacts.txt
publish:
needs: [ publishGradle, build, buildRerunTasks, functional, security, securityConfig, redis, hibernate5Functional, hibernate7Functional, mongodbFunctional, neo4jFunctional ]
# always() with explicit result checks, see the concurrency comment at the top. The results are checked
# explicitly because the implicit success() check also covers the skipped test jobs upstream, which would
# skip this job on a build-only run, and because a cancelled test job must not be published: the core of a
# commit whose tests were cancelled never reaches the snapshot repository, although its Gradle plugins may.
# Every test job of this workflow belongs in these needs.
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.buildRerunTasks.result == 'success' || needs.buildRerunTasks.result == 'skipped') &&
(needs.functional.result == 'success' || needs.functional.result == 'skipped') &&
(needs.security.result == 'success' || needs.security.result == 'skipped') &&
(needs.securityConfig.result == 'success' || needs.securityConfig.result == 'skipped') &&
(needs.redis.result == 'success' || needs.redis.result == 'skipped') &&
(needs.hibernate5Functional.result == 'success' || needs.hibernate5Functional.result == 'skipped') &&
(needs.hibernate7Functional.result == 'success' || needs.hibernate7Functional.result == 'skipped') &&
(needs.mongodbFunctional.result == 'success' || needs.mongodbFunctional.result == 'skipped') &&
(needs.neo4jFunctional.result == 'success' || needs.neo4jFunctional.result == 'skipped')
}}
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- name: "📤 Publish Grails-Core Snapshot Artifacts"
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
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: 3600 # normal range ~14-25min uncached (no tests); generous headroom for slow Nexus uploads so a single attempt is not killed mid-publish
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@v7.0.1
with:
name: grails-core-checksums.txt
path: build/grails-core-checksums.txt
- name: "📤 Upload grails-core published artifacts"
uses: actions/upload-artifact@v7.0.1
with:
name: grails-core-artifacts.txt
path: build/grails-core-artifacts.txt
- name: "🔨 Create Grails Wrapper Distribution Zip"
run: |
./gradlew :grails-wrapper:distZip
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
- name: "📤 Upload Wrapper Zip to Workflow Summary Page"
uses: actions/upload-artifact@v7.0.1
with:
name: apache-grails-wrapper-SNAPSHOT-bin
path: build/tmp/wrapper
publishForge:
# The implicit success() check also covers the skipped test jobs upstream of publish, which skipped this job
# on every build-only push although its own needs had succeeded; check them explicitly, as publish does.
# always() for the same reason as publish.
if: >-
${{ always() &&
github.repository_owner == 'apache' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.buildForge.result == 'success' &&
needs.publishGradle.result == 'success' &&
needs.publish.result == 'success'
}}
needs: [ buildForge, publishGradle, publish ]
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- name: "🔍 Setup TestLens"
uses: testlens-app/setup-testlens@89edf53f781ac41833b4bc74d0e19a5315c79c67 # v1.10.0
- 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@v7.0.1
with:
name: grails-forge-checksums
path: grails-forge/build/grails-forge-checksums.txt
- name: "📤 Upload grails-gradle published artifacts"
uses: actions/upload-artifact@v7.0.1
with:
name: grails-forge-artifacts.txt
path: grails-forge/build/grails-forge-artifacts.txt
verifyWrapper:
name: "Verify grails-wrapper"
# Verifies the wrapper works end-to-end. Must run after publishForge so that
# grails-cli (which the wrapper resolves at runtime) is available in Nexus.
# Explicit results and always() for the same reason as publishForge.
if: >-
${{ always() &&
github.repository_owner == 'apache' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
needs.publish.result == 'success' &&
needs.publishForge.result == 'success'
}}
needs: [ publish, publishForge ]
runs-on: ubuntu-22.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@v7.0.1
- name: "☕️ Setup JDK"
uses: actions/setup-java@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "📥 Download Wrapper"
uses: actions/download-artifact@v8.0.1
with:
name: apache-grails-wrapper-SNAPSHOT-bin
path: wrapper
- name: "✅ Verify grails-wrapper"
env:
GRAILS_WRAPPER_ALLOWED_TYPES: 'SNAPSHOT'
run: |
# Pin the wrapper to this branch's snapshot so it doesn't resolve the
# globally latest SNAPSHOT in the Apache repo, which may be compiled
# for a newer Java runtime than this job's JDK.
export PREFERRED_GRAILS_VERSION=$(grep '^projectVersion=' gradle.properties | cut -d'=' -f2)
# actions/download-artifact does not preserve the executable bit, so
# restore it before invoking the wrapper script (see actions/upload-artifact#38).
chmod +x ./wrapper/grailsw
./wrapper/grailsw --version
docs:
# Explicit results and always() for the same reason as publishForge.
if: >-
${{ always() &&
github.repository_owner == 'apache' &&
github.event_name == 'push' &&
needs.publish.result == 'success'
}}
needs: [ publish ]
runs-on: ubuntu-22.04
steps:
- name: "⚙️ Maximize build space"
run: |
echo "-- Dotnet"
sudo rm -rf /usr/share/dotnet
echo "-- Android"
sudo rm -rf /usr/local/lib/android
echo "-- Haskell"
sudo rm -rf /opt/ghc
echo "-- CodeQL"
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h
- 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@v7.0.1
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@v6.1.0
with:
distribution: liberica
java-version: 21
- name: "🗄️ Decide the Gradle cache mode"
id: gradle-cache-policy
uses: ./.github/actions/gradle-cache-policy
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
# Decided by the step above; see .github/actions/gradle-cache-policy.
cache-read-only: ${{ steps.gradle-cache-policy.outputs.read-only }}
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@v7.0.1
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'
# Only the default branch publishes docs/snapshot. Each publish
# replaces the whole folder, so the branches would overwrite each
# other, and a publish that overlaps another fails on the rebase.
# Like the CI and cache policies, this follows the default branch.
SKIP_SNAPSHOT_FOLDER: ${{ github.ref_name != github.event.repository.default_branch }}