leborchuk commented on code in PR #1171: URL: https://github.com/apache/cloudberry/pull/1171#discussion_r2206826371
########## .github/workflows/apache-rat-audit.yml: ########## @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------- +# +# 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 +# +# http://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. +# +# -------------------------------------------------------------------- +# Apache Rat Audit Workflow +# Checks if all files comply with Apache licensing requirements +# This workflow is based on the Apache Rat tool, you can run it locally +# using the command: `mvn clean verify -Drat.consoleOutput=true` +# -------------------------------------------------------------------- + +name: Apache Rat Audit + +on: + push: + branches: [main] + pull_request: + branches: [main] + types: [opened, synchronize, reopened, edited] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + rat-check: + name: Apache Rat License Check + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Set up Java and Maven + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + cache: maven + + - name: Run Apache Rat check + id: rat-check + run: | + echo "Running Apache Rat license check..." + mvn clean verify -Drat.consoleOutput=true | tee rat-output.log + + # Check for build failure + if grep -q "\[INFO\] BUILD FAILURE" rat-output.log; then + echo "rat_failed=true" >> $GITHUB_OUTPUT + echo "::error::Apache Rat check failed - build failure detected" + exit 1 + fi + + # If we got here, the check passed + echo "rat_failed=false" >> $GITHUB_OUTPUT + echo "Apache Rat check passed successfully" + + - name: Upload Rat check results + if: always() + uses: actions/upload-artifact@v4 + with: + name: rat-check-results + path: rat-output.log + retention-days: 7 + + - name: Generate Job Summary + if: always() + run: | + { + echo "## Apache Rat Audit Results" + echo "- Run Time: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" + + if [[ -f rat-output.log ]]; then + if grep -q "\[INFO\] BUILD FAILURE" rat-output.log; then Review Comment: Yep, I see the working workflow https://github.com/apache/cloudberry/actions/runs/16025107732/job/45211012810 But here there are only successful launches, ``` [INFO] Rat check: Summary over all files. Unapproved: 0, unknown: 0, generated: 1, approved: 5056 licenses. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS ``` Do you have any FAILURE example (I see in a history only success executions) in order to check we could catch the issue? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
