haystack/.github/workflows/openapi.yml
Sara Zan b93bbb1cab
refactor: upgrade actions version (#3506)
* upgrade actions version

* upgrade cache action too
2022-11-02 10:35:10 +01:00

55 lines
1.9 KiB
YAML

name: OpenAPI Schema
on:
workflow_dispatch: # Activate this workflow manually
pull_request:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: ./.github/actions/python_cache/
- name: Install Haystack
run: |
pip install --upgrade pip
pip install .[dev]
pip install -U rest_api/
- name: Update OpenAPI specs
run: python .github/utils/generate_openapi_specs.py
- name: Check status
run: |
if [[ `git status --porcelain` ]]; then
git status
echo "##################################################################################################"
git diff
echo "##################################################################################################"
echo "# "
echo "# CHECK FAILED! OpenAPI specs were not updated."
echo "# "
echo "# Please generate the new OpenAPI specs locally:"
echo "# "
echo "# python .github/utils/generate_openapi_specs.py"
echo "# "
echo "# You need a FULL INSTALLATION of Haystack for this step to work."
echo "# "
echo "# pip install -e .[all]"
echo "# "
echo "# If you cannot do that for any reason, please disable the hook, push "
echo "# and let us know in the PR description."
echo "# "
echo "# See https://github.com/deepset-ai/haystack/blob/main/CONTRIBUTING.md for instructions."
echo "# "
echo "# If you have further problems, please open an issue: https://github.com/deepset-ai/haystack/issues"
echo "# "
echo "###################################################################################################"
exit 1
fi