From 676efd693cfc1a96b4c762dfb7147287749c4de7 Mon Sep 17 00:00:00 2001 From: aman23bedi <168064369+aman23bedi@users.noreply.github.com> Date: Sat, 7 Sep 2024 02:23:21 +0530 Subject: [PATCH] test: Move run-all-gcpc-modules to GitHub Actions (#11157) * add gcpc modules tests to gha Signed-off-by: Amanpreet Singh Bedi * remove run-all-gcpc-modules test driver script Signed-off-by: Amanpreet Singh Bedi * fix path under gcpc modules tests github action Signed-off-by: Amanpreet Singh Bedi * upgrade ubuntu base image Signed-off-by: Amanpreet Singh Bedi * upgrade python version to 3.9 Signed-off-by: Amanpreet Singh Bedi --------- Signed-off-by: Amanpreet Singh Bedi Signed-off-by: Amanpreet Singh Bedi Co-authored-by: Amanpreet Singh Bedi Signed-off-by: sefgsefg --- .github/workflows/gcpc-modules-tests.yml | 56 +++++++++++++++++++++ test/presubmit-test-run-all-gcpc-modules.sh | 28 ----------- 2 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/gcpc-modules-tests.yml delete mode 100755 test/presubmit-test-run-all-gcpc-modules.sh diff --git a/.github/workflows/gcpc-modules-tests.yml b/.github/workflows/gcpc-modules-tests.yml new file mode 100644 index 000000000000..7ce9f4145e33 --- /dev/null +++ b/.github/workflows/gcpc-modules-tests.yml @@ -0,0 +1,56 @@ +name: GCPC modules test + +on: + push: + branches: [master] + + pull_request: + paths: + - '.github/workflows/gcpc-modules-tests.yml' + - 'sdk/python/**' + +jobs: + all-gcpc-tests: + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: apt-get update + run: sudo apt-get update + + - name: Install protobuf-compiler + run: sudo apt-get install protobuf-compiler -y + + - name: Install setuptools + run: | + pip3 install setuptools + pip3 freeze + + - name: Install Wheel + run: pip3 install wheel==0.42.0 + + - name: Install python sdk + run: pip install sdk/python + + - name: Generate API proto files + working-directory: ./api + run: make clean python + + - name: Install kfp-pipeline-spec from source + run: | + python3 -m pip install api/v2alpha1/python + + - name: Install google-cloud component + run: pip install components/google-cloud + + - name: Install Pytest + run: pip install $(grep 'pytest==' sdk/python/requirements-dev.txt) + + - name: Run test + run: pytest ./test/gcpc-tests/run_all_gcpc_modules.py diff --git a/test/presubmit-test-run-all-gcpc-modules.sh b/test/presubmit-test-run-all-gcpc-modules.sh deleted file mode 100755 index c47d92bc4cd4..000000000000 --- a/test/presubmit-test-run-all-gcpc-modules.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -ex -# Copyright 2023 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -source_root=$(pwd) - -pip install --upgrade pip -pip install $source_root/sdk/python -apt-get update && apt-get install -y protobuf-compiler -pushd api -make clean python -popd -python3 -m pip install api/v2alpha1/python -pip install components/google-cloud -pip install $(grep 'pytest==' sdk/python/requirements-dev.txt) - -pytest test/gcpc-tests/run_all_gcpc_modules.py