Merge branch 'shorthills-ai:master' into master #2
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
name: ⛩ Gateway ⛩ | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- branch-[0-9]+.[0-9]+ | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash --noprofile --norc -exo pipefail {0} | |
env: | |
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
jobs: | |
gateway: | |
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/untracked | |
- uses: ./.github/actions/setup-python | |
- name: Install dependencies | |
run: | | |
pip install .[gateway] \ | |
pytest pytest-timeout pytest-asyncio \ | |
httpx sentence-transformers transformers | |
# Ensure pydantic v2 is installed | |
pip freeze | tail -n +1 | grep -q '^pydantic==2\.' | |
- name: Run tests with pydantic v2 | |
run: | | |
pytest tests/gateway | |
- name: Downgrade pydantic to v1 | |
run: | | |
pip install 'pydantic<2.0' | |
# Ensure pydantic v1 is installed | |
pip freeze | tail -n +1 | grep -q '^pydantic==1\.' | |
- name: Run tests with pydantic v1 | |
run: | | |
pytest tests/gateway |