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

[chore][backend] Add workflow to validate affected generated files #11539

Merged
merged 1 commit into from
Feb 12, 2025
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
46 changes: 46 additions & 0 deletions .github/workflows/validate-generated-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Validate Generated Files
on:
pull_request:
paths:
- 'backend/api/**/*.proto'
- '.github/workflows/validate-generated-files.yml'
- 'backend/api/**/go_http_client/**'
- 'backend/api/**/go_client/**'
- 'backend/api/**/python_http_client/**'
- 'backend/api/**/swagger/**'

jobs:
validate-generated-files:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Dependencies
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler jq default-jdk
python3 -m pip install setuptools wheel

- name: Generate API proto files
working-directory: ./api
run: make clean all

- name: Generate kfp-kubernetes proto files from source
working-directory: ./kubernetes_platform
run: make clean all

- name: Check for Changes
run: make check-diff

13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Check diff for generated files
.PHONY: check-diff
check-diff:
/bin/bash -c 'if [[ -n "$$(git status --porcelain)" ]]; then \
echo "ERROR: Generated files are out of date"; \
echo "Please regenerate using make clean all for api and kubernetes_platform"; \
echo "Changes found in the following files:"; \
git status; \
echo "Diff of changes:"; \
git diff; \
exit 1; \
fi'
Loading
Loading