|
| 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 | + check_core_projects: |
| 29 | + name: "Core Projects" |
| 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: "📤 Upload Failure Reports" |
| 48 | + if: failure() |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: core-reports |
| 52 | + path: | |
| 53 | + **/build/reports/checkstyle/ |
| 54 | + **/build/reports/codenarc/ |
| 55 | + check_gradle_plugin_projects: |
| 56 | + name: "Gradle Plugin Projects" |
| 57 | + runs-on: ubuntu-24.04 |
| 58 | + steps: |
| 59 | + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it |
| 60 | + run: curl -s https://api.ipify.org |
| 61 | + - name: "📥 Checkout repository" |
| 62 | + uses: actions/checkout@v4 |
| 63 | + - name: "☕️ Setup JDK" |
| 64 | + uses: actions/setup-java@v4 |
| 65 | + with: |
| 66 | + distribution: liberica |
| 67 | + java-version: 17 |
| 68 | + - name: "🐘 Setup Gradle" |
| 69 | + uses: gradle/actions/setup-gradle@v4 |
| 70 | + with: |
| 71 | + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} |
| 72 | + - name: "🔎 Check Gradle Plugin Projects" |
| 73 | + working-directory: grails-gradle |
| 74 | + run: ./gradlew codeStyle |
| 75 | + - name: "📤 Upload Failure Reports" |
| 76 | + if: failure() |
| 77 | + uses: actions/upload-artifact@v4 |
| 78 | + with: |
| 79 | + name: gradle-plugin-reports |
| 80 | + path: | |
| 81 | + grails-gradle/**/build/reports/checkstyle/ |
| 82 | + grails-gradle/**/build/reports/codenarc/ |
| 83 | + check_grails_forge_projects: |
| 84 | + name: "Forge Projects" |
| 85 | + runs-on: ubuntu-24.04 |
| 86 | + steps: |
| 87 | + - name: "🌐 Output Agent IP" # in the event RAO blocks this agent, this can be used to debug it |
| 88 | + run: curl -s https://api.ipify.org |
| 89 | + - name: "📥 Checkout repository" |
| 90 | + uses: actions/checkout@v4 |
| 91 | + - name: "☕️ Setup JDK" |
| 92 | + uses: actions/setup-java@v4 |
| 93 | + with: |
| 94 | + distribution: liberica |
| 95 | + java-version: 17 |
| 96 | + - name: "🐘 Setup Gradle" |
| 97 | + uses: gradle/actions/setup-gradle@v4 |
| 98 | + with: |
| 99 | + develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }} |
| 100 | + - name: "🔎 Check Forge Projects" |
| 101 | + working-directory: grails-forge |
| 102 | + run: ./gradlew codeStyle |
| 103 | + - name: "📤 Upload Failure Reports" |
| 104 | + if: failure() |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: forge-reports |
| 108 | + path: | |
| 109 | + grails-forge/**/build/reports/checkstyle/ |
| 110 | + grails-forge/**/build/reports/checkstyleNohttp/ |
| 111 | + grails-forge/**/build/reports/codenarc/ |
0 commit comments