Skip to content

Commit 1f4739e

Browse files
committed
ci: run style checks in dedicated workflow
Style/formatting checks are executed only by the new workflow, keeping the main pipelines focused on build/test.
1 parent 3bb575b commit 1f4739e

File tree

3 files changed

+83
-12
lines changed

3 files changed

+83
-12
lines changed

.github/workflows/codestyle.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Code Style
17+
on:
18+
push:
19+
branches:
20+
- '[0-9]+.[0-9]+.x'
21+
pull_request:
22+
workflow_dispatch:
23+
# queue jobs and only allow 1 run per branch due to the likelihood of hitting GitHub resource limits
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: false
27+
jobs:
28+
codestyle:
29+
name: "Check Code Style"
30+
runs-on: ubuntu-24.04
31+
steps:
32+
- name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it
33+
run: curl -s https://api.ipify.org
34+
- name: "📥 Checkout repository"
35+
uses: actions/checkout@v4
36+
- name: "☕️ Setup JDK"
37+
uses: actions/setup-java@v4
38+
with:
39+
distribution: liberica
40+
java-version: 17
41+
- name: "🐘 Setup Gradle"
42+
uses: gradle/actions/setup-gradle@v4
43+
with:
44+
develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
45+
- name: "🔎 Check Core Projects"
46+
run: ./gradlew codeStyle
47+
- name: "🔎 Check Gradle Plugin Projects"
48+
working-directory: grails-gradle
49+
run: ./gradlew codeStyle

.github/workflows/gradle.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,19 @@ jobs:
5151
working-directory: 'grails-gradle'
5252
run: >
5353
./gradlew build
54-
--continue --stacktrace -PskipTests
54+
--continue
55+
--stacktrace
56+
-PskipCodeStyle
57+
-PskipTests
5558
- name: "🔨 Build project with tests"
5659
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
5760
working-directory: 'grails-gradle'
5861
run: >
5962
./gradlew build
60-
--continue --stacktrace
63+
--continue
64+
--stacktrace
6165
--rerun-tasks
66+
-PskipCodeStyle
6267
build:
6368
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
6469
name: 'Build Grails-Core'
@@ -85,8 +90,11 @@ jobs:
8590
- name: "🔨 Build project"
8691
run: >
8792
./gradlew build :grails-shell-cli:installDist groovydoc
88-
--continue --stacktrace -PonlyCoreTests
93+
--continue
8994
--rerun-tasks
95+
--stacktrace
96+
-PonlyCoreTests
97+
-PskipCodeStyle
9098
buildForge:
9199
name: "Build Grails Forge"
92100
strategy:
@@ -113,14 +121,19 @@ jobs:
113121
working-directory: 'grails-forge'
114122
run: >
115123
./gradlew build
116-
--continue --stacktrace -PskipTests
124+
--continue
125+
--stacktrace
126+
-PskipCodeStyle
127+
-PskipTests
117128
- name: "🔨 Build project with tests"
118129
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
119130
working-directory: 'grails-forge'
120131
run: >
121132
./gradlew build
122-
--continue --stacktrace
133+
--continue
123134
--rerun-tasks
135+
--stacktrace
136+
-PskipCodeStyle
124137
- name: "✅ Verify combined CLI"
125138
run: |
126139
cd grails-forge
@@ -162,11 +175,13 @@ jobs:
162175
- name: "🏃 Run Functional Tests"
163176
run: >
164177
./gradlew bootJar check
165-
--continue --stacktrace
178+
--continue
179+
--rerun-tasks
180+
--stacktrace
166181
-PonlyFunctionalTests
182+
-PskipCodeStyle
167183
-PskipHibernate5Tests
168184
-PskipMongodbTests
169-
--rerun-tasks
170185
mongodbFunctional:
171186
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
172187
name: "Mongodb Functional Tests"
@@ -195,10 +210,12 @@ jobs:
195210
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
196211
run: >
197212
./gradlew bootJar cleanTest check
198-
--continue --stacktrace
213+
--continue
214+
--rerun-tasks
215+
--stacktrace
199216
-PonlyMongodbTests
200217
-PmongodbContainerVersion=${{ matrix.mongodb-version }}
201-
--rerun-tasks
218+
-PskipCodeStyle
202219
hibernate5Functional:
203220
if: ${{ !contains(github.event.head_commit.message, '[skip tests]') }}
204221
name: "Hibernate5 Functional Tests"
@@ -226,9 +243,11 @@ jobs:
226243
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
227244
run: >
228245
./gradlew bootJar cleanTest check
229-
--continue --stacktrace
230-
-PonlyHibernate5Tests
246+
--continue
231247
--rerun-tasks
248+
--stacktrace
249+
-PonlyHibernate5Tests
250+
-PskipCodeStyle
232251
publishGradle:
233252
if: github.repository_owner == 'apache' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
234253
needs: [ buildGradle ]
@@ -256,7 +275,9 @@ jobs:
256275
working-directory: 'grails-gradle'
257276
run: >
258277
./gradlew publish aggregateChecksums aggregatePublishedArtifacts
259-
-Dorg.gradle.internal.publish.checksums.insecure=true --no-build-cache --rerun-tasks
278+
--no-build-cache
279+
--rerun-tasks
280+
-Dorg.gradle.internal.publish.checksums.insecure=true
260281
- name: "📤 Upload grails-gradle checksums"
261282
uses: actions/upload-artifact@v4
262283
with:

.github/workflows/groovy-joint-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,4 @@ jobs:
161161
run: >
162162
./gradlew build
163163
-x groovydoc
164+
-PskipCodeStyle

0 commit comments

Comments
 (0)