Skip to content

Commit

Permalink
Add target to check if gRPC code is in sync with generated python code
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanZRasa committed Jun 19, 2024
1 parent c69c9fe commit 68f755f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
git fetch --unshallow origin "${{ github.ref }}"
- name: Install Dependencies 📦
run: make install
run: make install-dev

- name: Lint Code 🎎
run: |
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ install:
poetry run python -m pip install -U pip
poetry install

install-dev:
poetry run python -m pip install -U pip
poetry install --with dev

clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
Expand All @@ -38,6 +42,7 @@ lint:
poetry run ruff check rasa_sdk tests --ignore D
poetry run black --exclude="rasa_sdk/grpc_py" --check rasa_sdk tests
make lint-docstrings
make check-generate-grpc-code-in-sync

# Compare against `main` if no branch was provided
BRANCH ?= main
Expand Down Expand Up @@ -69,3 +74,8 @@ generate-grpc:
--pyi_out=. \
proto/action_webhook.proto \
proto/health.proto

check-generate-grpc-code-in-sync: generate-grpc
# this is a helper to check if the generated code is in sync with the proto files
# it's not run on CI at the moment
git diff --exit-code rasa_sdk/grpc_py | if [ "$$(wc -c)" -eq 0 ]; then echo "Generated code is in sync with proto files"; else echo "Generated code is not in sync with proto files"; exit 1; fi

0 comments on commit 68f755f

Please sign in to comment.