-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check generated diff from proto files
Signed-off-by: chahatsagarmain <[email protected]> Check if there is a difference in generated files Signed-off-by: chahatsagarmain <[email protected]>
- Loading branch information
1 parent
af4540e
commit 612fd23
Showing
3 changed files
with
577 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
# Check diff for generated files | ||
.PHONY: check-diff | ||
check-diff: | ||
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 |
Oops, something went wrong.