Skip to content

Commit

Permalink
ci(Bindings) Add check-bindings to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Nov 19, 2020
1 parent 15b5fd2 commit a45e07e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ potential risk of the type bindings and schema YAML to drift out of sync.
One remedy we have in place is to use [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).
This allows us to automatically build the schema, detects changes in the bindings, and commit them prior to each push command.

To see the exact steps being performed, please see the [`checkBindings`](./Makefile) command in the `Makefile`.
To see the exact steps being performed, please see the [`check-bindings`](./Makefile) command in the `Makefile`.

## Developing with Docker

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RNAMESPACE := 'r/NAMESPACE'

# Build schema bindings for Python and R. If the bindings have changed, this script
# will commit the updated bindings. This script is run automatically as a git pre-push hook.
checkBindings:
check-bindings:
@echo "🔬 Checking if schema bindings have changed"
@echo "🏗 Building schema language bindings"
npm run build:jsonschema
Expand All @@ -53,13 +53,13 @@ checkBindings:
@for i in $$(git ls-files -m); do \
if [ "$$i" = $(PYBINDINGS) ] || [ "$$i" = $(RBINDINGS) ] ; then \
echo "☝️ Bindings have changed, please verify and commit them."; \
echo "If there are no other changes, you can run \"make commitBindings\"\n\n"; \
echo "If there are no other changes, you can run \"make commit-bindings\"\n\n"; \
exit 1; \
fi \
done

# Commits just the updated schema bindings
commitBindings:
commit-bindings:
git commit --only $(PYBINDINGS) $(RBINDINGS) $(RNAMESPACE) -m "chore(Language bindings): Update type bindings"


Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- script: npm run test:cover
displayName: Run tests

- script: make check-bindings
displayName: Check bindings

- script: npm run build
displayName: Build package

Expand Down

0 comments on commit a45e07e

Please sign in to comment.