Skip to content

[#10476] improvement(cli): Add SupportsPolicies interface #29350

[#10476] improvement(cli): Add SupportsPolicies interface

[#10476] improvement(cli): Add SupportsPolicies interface #29350

Workflow file for this run

name: build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main", "branch-*" ]
paths-ignore:
- '**/*.md'
- '**/*.mdx'
- 'docs/assets/**'
- 'web-v2/**'
pull_request:
branches: [ "main", "branch-*" ]
paths-ignore:
- '**/*.md'
- '**/*.mdx'
- 'docs/assets/**'
- 'web-v2/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
id: filter
with:
list-files: shell
filters: |
source_changes:
- '.github/**'
- 'catalogs/**'
- 'catalogs-contrib/**'
- 'clients/**'
- 'conf/**'
- 'dev/**'
- 'docs/open-api/**'
- 'gradle/**'
- 'gradle.properties'
- 'meta/**'
- 'scripts/**'
- 'web/**'
- '**/*.java'
- '**/*.kts'
- '**/*.py'
- '**/*.rs'
- '**/resources/**'
- '**/src/**'
- '!**/*.md'
- '!**/*.mdx'
- '!docs/**/*.png'
- '!docs/**/*.svg'
- '!docs/**/*.jpg'
- '!docs/**/*.jpeg'
- '!docs/**/*.gif'
- '!docs/**/*.webp'
- 'mcp-server/**'
spark_connector_changes:
- 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
needs: changes
if: needs.changes.outputs.source_changes != 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
run: |
./gradlew assemble
# To check the spark-connector is compatible with scala2.13
spark-connector-build:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: changes
if: needs.changes.outputs.spark_connector_changes == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'gradle'
- name: Free up disk space
run: |
dev/ci/util_free_space.sh
- name: Build with Scala2.13
run: |
./gradlew :spark-connector:spark-3.3:build -PscalaVersion=2.13 -PskipITs -PskipDockerTests=false
./gradlew :spark-connector:spark-3.4:build -PscalaVersion=2.13 -PskipITs -PskipDockerTests=false
./gradlew :spark-connector:spark-3.5:build -PscalaVersion=2.13 -PskipITs -PskipDockerTests=false
- name: Upload unit tests report
uses: actions/upload-artifact@v7
if: failure()
with:
name: unit test report
path: |
build/reports
spark-connector/**/*.log
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17 ]
timeout-minutes: 90
needs: changes
if: needs.changes.outputs.source_changes == 'true'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'gradle'
- name: Test publish to local
run: ./gradlew publishToMavenLocal -x test
- name: Free up disk space
run: |
dev/ci/util_free_space.sh
- name: Install dependencies
run: |
wget https://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
- name: Build with Gradle
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'
./gradlew "${gradle_args[@]}"
- name: Fetch base branch for coverage diff
if: github.event_name == 'pull_request'
run: git fetch origin ${{ github.base_ref }} --depth=1
- name: Generate Coverage Report
id: coverage
if: github.event_name == 'pull_request'
run: |
python3 dev/ci/jacoco_report.py \
--base-ref "${{ github.base_ref }}" \
--head-sha "${{ github.event.pull_request.head.sha }}" \
--repo-url "${{ github.event.pull_request.head.repo.html_url }}" \
--min-overall 40 \
--min-changed 60 \
--output coverage-report.md
- name: Save PR number
if: github.event_name == 'pull_request' && steps.coverage.outputs.has_reports == 'true'
run: echo "${{ github.event.pull_request.number }}" > pr-number.txt
- name: Upload Coverage Report
if: github.event_name == 'pull_request' && steps.coverage.outputs.has_reports == 'true'
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: |
coverage-report.md
pr-number.txt
- name: Output Coverage Info
if: github.event_name == 'pull_request' && steps.coverage.outputs.has_reports == 'true'
run: |
echo "Total coverage ${{ steps.coverage.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.coverage.outputs.coverage-changed-files }}"
- name: Upload unit tests report
uses: actions/upload-artifact@v7
if: failure()
with:
name: unit test report
path: |
build/reports
catalogs-contrib/**/*.log
catalogs-contrib/**/*.tar
catalogs/**/*.log
catalogs/**/*.tar