From a149ea9ea2a674fd7e31f3a4bf178d0340d78be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 9 Oct 2024 09:48:25 +0200 Subject: [PATCH] ci: add a check to ensure the pipeline is up to date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If someone pushes code changes and the pipeline.yaml has not been updated accordingly, the CI will fail and ask to update it and push again. Also, you can now generate a pipeline with `make pipeline`. Signed-off-by: Sébastien Han --- .github/workflows/pre_commit.yaml | 6 ++++++ Makefile | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre_commit.yaml b/.github/workflows/pre_commit.yaml index 15c591dd..cf7d996e 100644 --- a/.github/workflows/pre_commit.yaml +++ b/.github/workflows/pre_commit.yaml @@ -34,3 +34,9 @@ jobs: - name: Run pre-commit run: | pre-commit run --all-files + + - name: Test if pipeline is up-to-date + run: | + pip install click kfp==2.9.0 kfp.kubernetes + make pipeline + git diff --exit-code || (echo "Pipeline is not up-to-date. Please run 'make pipeline' and commit the changes." && exit 1) diff --git a/Makefile b/Makefile index 769cf6dd..8a1a5695 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ -.PHONY: standalone +.PHONY: standalone pipeline standalone: python3 pipeline.py gen-standalone ruff format standalone/standalone.py + +pipeline: + python3 pipeline.py