diff --git a/.github/workflows/backend-integration-test.yml b/.github/workflows/backend-integration-test.yml index 68c616f8ec9..d646f4763a1 100644 --- a/.github/workflows/backend-integration-test.yml +++ b/.github/workflows/backend-integration-test.yml @@ -26,7 +26,10 @@ jobs: - api/** - bin/** - catalogs/** - - clients/** + - clients/client-java/** + - clients/client-java-runtime/** + - clients/filesystem-hadoop3/** + - clients/filesystem-hadoop3-runtime/** - common/** - conf/** - core/** diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71facb817f6..93f9ec9af91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,10 @@ jobs: - api/** - bin/** - catalogs/** - - clients/** + - clients/client-java/** + - clients/client-java-runtime/** + - clients/filesystem-hadoop3/** + - clients/filesystem-hadoop3-runtime/** - common/** - conf/** - core/** diff --git a/.github/workflows/frontend-integration-test.yml b/.github/workflows/frontend-integration-test.yml index f05174d33b9..b323f0e3d82 100644 --- a/.github/workflows/frontend-integration-test.yml +++ b/.github/workflows/frontend-integration-test.yml @@ -26,7 +26,10 @@ jobs: - api/** - bin/** - catalogs/** - - clients/** + - clients/client-java/** + - clients/client-java-runtime/** + - clients/filesystem-hadoop3/** + - clients/filesystem-hadoop3-runtime/** - common/** - conf/** - core/** diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml new file mode 100644 index 00000000000..3e261024ec2 --- /dev/null +++ b/.github/workflows/python-ci.yml @@ -0,0 +1,25 @@ +name: 'Python CI' + +on: + push: + branches: [ "main", "branch-*" ] + + pull_request: + branches: [ "main", "branch-*" ] + paths: + - 'clients/client-python/**' +concurrency: + group: ${{ github.worklfow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_requests' }} + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python: [ '3.8', '3.9', '3.10', '3.11' ] + + steps: + - uses: actions/checkout@v4 + - name: Unit tests + run: ./gradlew clean clients:client-python:test \ No newline at end of file diff --git a/clients/client-python/build.gradle.kts b/clients/client-python/build.gradle.kts new file mode 100644 index 00000000000..9c48201a145 --- /dev/null +++ b/clients/client-python/build.gradle.kts @@ -0,0 +1,37 @@ +/* + * Copyright 2024 Datastrato Pvt Ltd. + * This software is licensed under the Apache License version 2. + */ + +tasks.withType(Exec::class) { + workingDir = file("${project.projectDir}") +} + +tasks { + val pythonVersion by registering(Exec::class) { + commandLine("python", "--version") + } + + val installPip by registering(Exec::class) { + dependsOn(pythonVersion) + commandLine("python", "-m", "pip", "install", "--upgrade", "pip") + } + + val installDeps by registering(Exec::class) { + dependsOn(installPip) + commandLine("python", "-m", "pip", "install", "-r", "requirements.txt") + } + + val pyTest by registering(Exec::class) { + dependsOn(installDeps) + commandLine("pytest", "${project.projectDir}/tests") + } + + test { + dependsOn(pyTest) + } + + clean { + delete("build") + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index a98a37c21e8..bf872bc0ef6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,7 +20,13 @@ include( ) include("catalogs:catalog-hadoop") include("catalogs:catalog-messaging-kafka") -include("clients:client-java", "clients:client-java-runtime", "clients:filesystem-hadoop3", "clients:filesystem-hadoop3-runtime") +include( + "clients:client-java", + "clients:client-java-runtime", + "clients:filesystem-hadoop3", + "clients:filesystem-hadoop3-runtime", + "clients:client-python" +) include("trino-connector") include("spark-connector") include("web")