Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2518] feat(build): support Github CI for client-python #2684

Merged
merged 7 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/backend-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/frontend-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions clients/client-python/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
}
8 changes: 7 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading