Skip to content

Commit b2909f8

Browse files
committed
test: Add script and GitHub Action for kfp-kubernetes-library
Signed-off-by: Diego Lovison <diegolovison@gmail.com>
1 parent 4930bee commit b2909f8

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: KFP K8s Platform Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
paths:
8+
- '.github/workflows/kfp-kubernetes-library.yaml'
9+
- 'sdk/python/**'
10+
- 'api/v2alpha1/**'
11+
- 'kubernetes_platform/**'
12+
- 'test/presubmit-test-kfp-kubernetes-library.sh'
13+
14+
jobs:
15+
kfp-kubernetes-library-test:
16+
runs-on: ubuntu-24.04
17+
strategy:
18+
matrix:
19+
python: [
20+
{ 'version': '3.8' },
21+
{ 'version': '3.9' },
22+
{ 'version': '3.10' },
23+
{ 'version': '3.11' },
24+
{ 'version': '3.12' }
25+
]
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{matrix.python.version}}
34+
35+
- name: Run tests
36+
# original file is using sudo
37+
run: ./test/presubmit-test-kfp-kubernetes-library.sh

test/presubmit-test-kfp-kubernetes-library.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,20 @@
1515

1616
source_root=$(pwd)
1717

18+
if [ $(id -u) = 0 ]; then
19+
apt-get update && apt-get install -y protobuf-compiler
20+
# rust needed for transitive deps in dev extras on Python:3.12
21+
apt-get install rustc -y
22+
else
23+
sudo apt-get update && sudo apt-get install -y protobuf-compiler
24+
# rust needed for transitive deps in dev extras on Python:3.12
25+
sudo apt-get install rustc -y
26+
fi
27+
1828
pip install --upgrade pip
1929
pip install wheel
20-
2130
pip install sdk/python
22-
apt-get update && apt-get install -y protobuf-compiler
31+
2332
pushd api
2433
make clean python
2534
popd
@@ -31,7 +40,5 @@ pushd "$source_root/kubernetes_platform"
3140
make clean python
3241
popd
3342

34-
# rust needed for transitive deps in dev extras on Python:3.12
35-
apt-get install rustc -y
3643
pip install -e "$source_root/kubernetes_platform/python[dev]"
3744
pytest "$source_root/kubernetes_platform/python/test" -n auto

0 commit comments

Comments
 (0)