tkobayas commented on code in PR #6860: URL: https://github.com/apache/incubator-kie/pull/6860#discussion_r3892414776
########## .github/actions/ci-setup/action.yaml: ########## @@ -0,0 +1,128 @@ +# +# 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 Setup" +description: "Shared CI setup: checkout, Java, JBang, Maven settings, build scope computation" + +inputs: + ref: + description: "Base ref for PR checkout" + required: true + java-version: + description: "Java version to set up" + required: true + +runs: + using: "composite" + steps: + - name: 'SETUP :: Free disk space (Ubuntu)' + if: runner.os == 'Linux' + shell: bash + run: | + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc + df -h + + - name: 'SETUP :: Enable long file paths (Windows)' + if: runner.os == 'Windows' + shell: pwsh + run: | + git config --system core.longpaths true + reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f + + - name: "SETUP :: Checkout @ Simulated squashed-merge if PR, else checkout current commit" + uses: ./.github/actions/checkout-pr + with: + ref: ${{ inputs.ref }} + + - uses: actions/setup-java@v5 + name: 'SETUP :: Java ${{ inputs.java-version }}' + with: + java-version: ${{ inputs.java-version }} + distribution: temurin + cache: maven + + # Temporary workaround while jbangdev/setup-jbang action doesn't include checksum verification. + # See https://github.com/apache/infrastructure-actions/pull/806 + - 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 :: 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" + echo "MAVEN_PL_AFFECTED_DROOLS_FILE=${{ runner.temp }}/maven-pl-affected-drools.txt" >> "$GITHUB_ENV" + echo "MAVEN_PL_AFFECTED_OPTAPLANNER_FILE=${{ runner.temp }}/maven-pl-affected-optaplanner.txt" >> "$GITHUB_ENV" + echo "MAVEN_PL_AFFECTED_KOGITO_RUNTIMES_FILE=${{ runner.temp }}/maven-pl-affected-kogito-runtimes.txt" >> "$GITHUB_ENV" + echo "MAVEN_PL_AFFECTED_KOGITO_APPS_FILE=${{ runner.temp }}/maven-pl-affected-kogito-apps.txt" >> "$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" + touch "${{ runner.temp }}/maven-pl-affected-drools.txt" + touch "${{ runner.temp }}/maven-pl-affected-optaplanner.txt" + touch "${{ runner.temp }}/maven-pl-affected-kogito-runtimes.txt" + touch "${{ runner.temp }}/maven-pl-affected-kogito-apps.txt" Review Comment: Thanks. Applied the partition approach. Filenames are `partition0.txt`, `partition1.txt`... for easier processing. We can add a comment line like `# optaplanner` for explanation. Also we have "implicit default" partition which catches: - Modules in zero explicit partitions' closures (= not referenced by any leaves in the partition files) - Modules in multiple explicit partitions' closures (shared modules like `kogito-api`) -- 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]
