World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#10115] improvement(ci): Optimize build workflow for maintenance changes (#10424)
FANNGdabbce4fd5ab
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex e7a4386c3d..bd0ba9b2ef 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -31,6 +31,7 @@ jobs:- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36id: filterwith:+ list-files: shellfilters: |source_changes:- '.github/**'@@ -64,10 +65,39 @@ jobs:- spark-connector/**mcp_server_changes:- mcp-server/**+ - name: Determine maintenance-module-only changes+ id: maintenance_module_only+ env:+ SOURCE_CHANGE_FILES: ${{ steps.filter.outputs.source_changes_files }}+ run: |+ # Route to the maintenance-only build path only when every source+ # change in the PR is under maintenance/. Non-source changes are+ # already filtered out by source_changes_files.+ source_files=()+ if [ -n "${SOURCE_CHANGE_FILES}" ]; then+ eval "source_files=(${SOURCE_CHANGE_FILES})"+ fi++ maintenance_module_only=false+ if [ "${#source_files[@]}" -gt 0 ]; then+ maintenance_module_only=true+ for path in "${source_files[@]}"; do+ case "$path" in+ maintenance/*) ;;+ *)+ maintenance_module_only=false+ break+ ;;+ esac+ done+ fi++ echo "maintenance_module_only_changes=${maintenance_module_only}" >> "${GITHUB_OUTPUT}"outputs:source_changes: ${{ steps.filter.outputs.source_changes }}spark_connector_changes: ${{ steps.filter.outputs.spark_connector_changes }}mcp_server_changes: ${{ steps.filter.outputs.mcp_server_changes }}+ maintenance_module_only_changes: ${{ steps.maintenance_module_only.outputs.maintenance_module_only_changes }}compile-check:runs-on: ubuntu-latest@@ -153,12 +183,39 @@ jobs:sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb- name: Build with Gradle- if: needs.changes.outputs.mcp_server_changes == 'true'- run: ./gradlew build -PskipITs -PskipDockerTests=false -x :clients:client-python:build+ run: |+ if [ "${{ needs.changes.outputs.maintenance_module_only_changes }}" = "true" ]; then+ ./gradlew \+ :maintenance:optimizer-api:build \+ :maintenance:updaters:build \+ :maintenance:optimizer:build \+ :maintenance:jobs:build \+ -PskipITs \+ -PskipDockerTests=false+ exit 0+ fi++ gradle_args=(+ build+ -PskipITs+ -PskipDockerTests=false+ -x :clients:client-python:build+ )++ if [ "${{ needs.changes.outputs.mcp_server_changes }}" != "true" ]; then+ gradle_args+=(+ -x :mcp-server:build+ -x :mcp-server:test+ -x :mcp-server:pylint+ -x :web-v2:web:build+ )+ fi++ printf './gradlew'+ printf ' %q' "${gradle_args[@]}"+ printf '\n'- - name: Build with Gradle (skip mcp-server tests)- if: needs.changes.outputs.mcp_server_changes != 'true'- run: ./gradlew build -PskipITs -PskipDockerTests=false -x :clients:client-python:build -x :mcp-server:build -x :mcp-server:test -x :mcp-server:pylint -x :web-v2:web:build+ ./gradlew "${gradle_args[@]}"- name: Fetch base branch for coverage diffif: github.event_name == 'pull_request'