-
-
Notifications
You must be signed in to change notification settings - Fork 970
140 lines (139 loc) Β· 6.18 KB
/
codestyle.yml
File metadata and controls
140 lines (139 loc) Β· 6.18 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
# 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: "Code Style"
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: ${{ github.event_name == 'pull_request' }}
jobs:
check_core_projects:
name: "Core Projects"
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@v6
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "π Check Core Projects"
run: ./gradlew codeStyle
- name: "π€ Upload Failure Reports"
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: core-reports
path: build/reports/codestyle/
- name: "π Publish Code Style Report in Job Summary"
if: always()
run: |
echo "## π Code Style Report - Core Projects" >> $GITHUB_STEP_SUMMARY
for file in build/reports/codestyle/checkstyle/*.xml build/reports/codestyle/codenarc/*.xml; do
[ -f "$file" ] || continue
if grep -q "<error " "$file" || grep -q "<Violation " "$file"; then
echo "### β $(basename $file .xml)" >> $GITHUB_STEP_SUMMARY
grep "<error " "$file" | awk -F'"' '{print "- **Line " $2 "**: " $8}' >> $GITHUB_STEP_SUMMARY
grep "<Violation " "$file" | awk -F"'" '{print "- **Line " $6 "**: " $2}' >> $GITHUB_STEP_SUMMARY
fi
done
check_gradle_plugin_projects:
name: "Gradle Plugin Projects"
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@v6
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "π Check Gradle Plugin Projects"
working-directory: grails-gradle
run: ./gradlew codeStyle
- name: "π€ Upload Failure Reports"
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: gradle-plugin-reports
path: grails-gradle/build/reports/codestyle/
- name: "π Publish Code Style Report in Job Summary"
if: always()
run: |
echo "## π Code Style Report - Gradle Plugin Projects" >> $GITHUB_STEP_SUMMARY
for file in grails-gradle/build/reports/codestyle/checkstyle/*.xml grails-gradle/build/reports/codestyle/codenarc/*.xml; do
[ -f "$file" ] || continue
if grep -q "<error " "$file" || grep -q "<Violation " "$file"; then
echo "### β $(basename $file .xml)" >> $GITHUB_STEP_SUMMARY
grep "<error " "$file" | awk -F'"' '{print "- **Line " $2 "**: " $8}' >> $GITHUB_STEP_SUMMARY
grep "<Violation " "$file" | awk -F"'" '{print "- **Line " $6 "**: " $2}' >> $GITHUB_STEP_SUMMARY
fi
done
check_grails_forge_projects:
name: "Forge Projects"
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@v6
- name: "βοΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
- name: "π Setup Gradle"
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "π Check Forge Projects"
working-directory: grails-forge
run: ./gradlew codeStyle
- name: "π€ Upload Failure Reports"
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: forge-reports
path: grails-forge/build/reports/codestyle/
- name: "π Publish Code Style Report in Job Summary"
if: always()
run: |
echo "## π Code Style Report - Forge Projects" >> $GITHUB_STEP_SUMMARY
for file in grails-forge/build/reports/codestyle/checkstyle/*.xml grails-forge/build/reports/codestyle/codenarc/*.xml; do
[ -f "$file" ] || continue
if grep -q "<error " "$file" || grep -q "<Violation " "$file"; then
echo "### β $(basename $file .xml)" >> $GITHUB_STEP_SUMMARY
grep "<error " "$file" | awk -F'"' '{print "- **Line " $2 "**: " $8}' >> $GITHUB_STEP_SUMMARY
grep "<Violation " "$file" | awk -F"'" '{print "- **Line " $6 "**: " $2}' >> $GITHUB_STEP_SUMMARY
fi
done