Copilot commented on code in PR #7154: URL: https://github.com/apache/incubator-kie/pull/7154#discussion_r4217619883
########## .github/workflows/ci_java17_compat.yml: ########## @@ -0,0 +1,179 @@ +# +# 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. +# + +name: "CI :: Build (Java 17)" + +on: + pull_request: + types: [opened, synchronize, reopened, closed] Review Comment: Triggering on `pull_request.closed` starts a workflow run that immediately skips the job (`if: github.event.action != 'closed'`). Removing `closed` avoids unnecessary workflow invocations/noise and reduces Actions load while keeping the same effective behavior. ########## .github/workflows/ci_java17_compat.yml: ########## @@ -0,0 +1,179 @@ +# +# 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. +# + +name: "CI :: Build (Java 17)" + +on: + pull_request: + types: [opened, synchronize, reopened, closed] + branches: [main] + paths-ignore: + - 'LICENSE' + - '**/.gitignore' + - '**.md' + - '**.adoc' + - '*.txt' + - 'docsimg/**' + - '.ci/jenkins/**' + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + + build: + if: github.event.action != 'closed' + name: 'Java 17' + runs-on: ubuntu-latest + + steps: + - name: 'SETUP :: Set paths for temporary files' + shell: bash + run: | + echo "CHANGED_FILES_FILE=${{ runner.temp }}/changed-files.txt" >> "$GITHUB_ENV" + echo "MAVEN_PL_AFFECTED_FILE=${{ runner.temp }}/maven-pl-affected.txt" >> "$GITHUB_ENV" + echo "MAVEN_PL_UPSTREAM_FILE=${{ runner.temp }}/maven-pl-upstream.txt" >> "$GITHUB_ENV" + echo "MAVEN_PL_CHANGED_FILE=${{ runner.temp }}/maven-pl-changed.txt" >> "$GITHUB_ENV" + echo "DEP_GRAPH_EXTRACTOR__OUTPUT_FILE=${{ runner.temp }}/dep-graph.tsv" >> "$GITHUB_ENV" + touch "${{ runner.temp }}/changed-files.txt" + touch "${{ runner.temp }}/maven-pl-affected.txt" + touch "${{ runner.temp }}/maven-pl-upstream.txt" + touch "${{ runner.temp }}/maven-pl-changed.txt" + + - name: 'SETUP :: Free disk space (Ubuntu)' + shell: bash + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc + df -h + + - name: "SETUP :: Checkout to load local actions" + uses: actions/checkout@v7 + + - name: "SETUP :: Checkout @ Simulated squashed-merge if PR, else checkout current commit" + id: checkout_pr + uses: ./.github/actions/checkout-pr + with: + ref: ${{ github.base_ref }} + + - uses: actions/setup-java@v6 + name: 'SETUP :: Java 17' + with: + java-version: 17 + distribution: temurin + cache: maven + + - name: 'SETUP :: Install JBang' + shell: bash + run: | + curl -sL https://github.com/jbangdev/jbang/releases/download/v0.138.0/jbang-0.138.0.zip -o jbang.zip + echo "3c9fb9ac5823ae5ab9d136dec08b896e2a0f6f6b313689b21f43c511b7c34b85 jbang.zip" | sha256sum -c - + unzip -q jbang.zip + echo "${{ github.workspace }}/jbang-0.138.0/bin" >> $GITHUB_PATH + + - name: 'SETUP :: Block apache.snapshots Maven repository' + shell: bash + run: | + mkdir -p "$HOME/.m2" + cat > "$HOME/.m2/settings.xml" <<'EOF' + <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd"> + <mirrors> + <mirror> + <id>block-apache-snapshots</id> + <mirrorOf>apache.snapshots,apache-snapshot-repository</mirrorOf> + <url>https://repository.apache.org/snapshots/</url> + <blocked>true</blocked> + </mirror> + </mirrors> + </settings> + EOF + + - name: 'SETUP :: Collect changed files' + if: github.event_name == 'pull_request' + shell: bash + env: + BASE_REF: origin/${{ github.base_ref }} + run: | + git diff --name-only "${BASE_REF}...HEAD" > "$CHANGED_FILES_FILE" + echo "Changed files:" + cat "$CHANGED_FILES_FILE" + + - name: 'SETUP :: Compute build scopes' + if: github.event_name == 'pull_request' + shell: bash + run: | + jbang script/ci/CiComputeBuildScopes.java \ + "$CHANGED_FILES_FILE" \ + "$MAVEN_PL_UPSTREAM_FILE" \ + "$MAVEN_PL_AFFECTED_FILE" \ + "$MAVEN_PL_CHANGED_FILE" + + - name: "PR CHECK :: BUILD :: Upstream modules${{ github.event_name == 'push' && ' (skipped)' || '' }}" + if: github.event_name == 'pull_request' + shell: bash + run: | + pl=$(paste -sd, "$MAVEN_PL_UPSTREAM_FILE") + [ -z "$pl" ] && echo "No upstream modules. Skipping." && exit 0 + mvn -T 1C --batch-mode --no-transfer-progress -fae -DskipTests -DskipITs -Denforcer.skip=true -Dcheckstyle.skip=true -Dformatter.skip=true -Darchunit.skip=true -Dsurefire.redirectTestOutputToFile=true -pl "$pl" install + + - name: "PR CHECK :: BUILD :: Changed and affected modules${{ github.event_name == 'push' && ' (skipped)' || '' }}" + if: github.event_name == 'pull_request' + shell: bash + run: | + pl=$(paste -sd, "$MAVEN_PL_AFFECTED_FILE") + [ -z "$pl" ] && echo "No affected modules. Skipping." && exit 0 + mvn --batch-mode --no-transfer-progress -fae -Dsurefire.redirectTestOutputToFile=true -Dfull -Dreproducible -pl "$pl" install + + - name: "CI :: BUILD :: Full${{ github.event_name == 'pull_request' && ' (skipped)' || '' }}" + if: github.event_name == 'push' + shell: bash + run: mvn --batch-mode --no-transfer-progress -fae -Dsurefire.redirectTestOutputToFile=true -Dfull -Dreproducible install + + - name: 'SUMMARY :: Publish' + if: always() + shell: bash + env: + MERMAID_EXPANDED: ${{ matrix.os == 'ubuntu-latest' }} Review Comment: `matrix` is referenced in this workflow, but this job does not define a matrix strategy. This will fail expression evaluation (unrecognized `matrix`). Set `MERMAID_EXPANDED` based on `runner.os`, hardcode it, or remove the condition. -- 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]
