Skip to content

Commit

Permalink
test: Add script and GitHub Action for kfp-kubernetes-library (#11006)
Browse files Browse the repository at this point in the history
* test: Add script and GitHub Action for kfp-kubernetes-library

Signed-off-by: Diego Lovison <diegolovison@gmail.com>

* Rename

Signed-off-by: Diego Lovison <diegolovison@gmail.com>

* Update bash to have sudo

Signed-off-by: Diego Lovison <diegolovison@gmail.com>

---------

Signed-off-by: Diego Lovison <diegolovison@gmail.com>
  • Loading branch information
diegolovison authored Jul 31, 2024
1 parent ad03bb6 commit c420f8c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/kfp-kubernetes-library-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: kfp-kubernetes library tests

on:
push:
branches: [master]
pull_request:
paths:
- '.github/workflows/kfp-kubernetes-library-test.yaml'
- 'sdk/python/**'
- 'api/v2alpha1/**'
- 'kubernetes_platform/**'
- 'test/presubmit-test-kfp-kubernetes-library.sh'

jobs:
kfp-kubernetes-library-test:
runs-on: ubuntu-24.04
strategy:
matrix:
python: [
{ 'version': '3.8' },
{ 'version': '3.9' },
{ 'version': '3.10' },
{ 'version': '3.11' },
{ 'version': '3.12' }
]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python.version}}

- name: Run tests
run: ./test/presubmit-test-kfp-kubernetes-library.sh
6 changes: 3 additions & 3 deletions test/presubmit-test-kfp-kubernetes-library.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -ex
# Copyright 2023 Kubeflow Pipelines contributors
# Copyright 2024 Kubeflow Pipelines contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@ pip install --upgrade pip
pip install wheel

pip install sdk/python
apt-get update && apt-get install -y protobuf-compiler
sudo apt-get update && sudo apt-get install -y protobuf-compiler
pushd api
make clean python
popd
Expand All @@ -32,6 +32,6 @@ make clean python
popd

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

0 comments on commit c420f8c

Please sign in to comment.