ci: check and dispatch api schema changes

- check if api schema is outdated
- do not cancel in progress workflow
  Since this workflow commit to an external repo, it might squash multiple changes into a single commit.
- dispatch each schema update to client repo
- cache pip dependencies
This commit is contained in:
jo 2022-06-17 17:07:44 +02:00 committed by Kyle Robbertze
parent 08bcaf459c
commit b10696265f
2 changed files with 87 additions and 22 deletions

View file

@ -15,7 +15,8 @@ test: $(VENV)
source $(VENV)/bin/activate
DJANGO_SETTINGS_MODULE=libretime_api.settings.testing pytest -n $(CPU_CORES) --color=yes -v libretime_api
SCHEMA_FILE ?= schema.yml
schema: $(VENV)
source $(VENV)/bin/activate
DJANGO_SETTINGS_MODULE=libretime_api.settings.testing libretime-api spectacular --file schema.yml
if command -v npx > /dev/null; then npx prettier --write schema.yml; fi
DJANGO_SETTINGS_MODULE=libretime_api.settings.testing libretime-api spectacular --file $(SCHEMA_FILE)
if command -v npx > /dev/null; then npx prettier --write $(SCHEMA_FILE); fi