This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
Fastapi mangum extras #416
Workflow file for this run
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python application | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test-dir: ["unit", "integration"] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
env: | |
UNIONML_CI: "1" | |
AWS_ACCESS_KEY_ID: minio | |
AWS_SECRET_ACCESS_KEY: miniostorage | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements files | |
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('requirements.txt', 'requirements-dev.txt', 'requirements-docs.txt')) }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install awscli | |
pip install typing_extensions # required for mangum install | |
pip install -r requirements-docs.txt | |
pip install --no-deps -e . | |
- name: Pip info | |
run: python -m pip list | |
- name: Lint | |
run: | | |
pre-commit run --all-files --show-diff-on-failure | |
- name: Install FlyteCTL | |
if: ${{ matrix.test-dir == 'integration' }} | |
uses: unionai-oss/flytectl-setup-action@master | |
- name: Setup Flyte Sandbox | |
if: ${{ matrix.test-dir == 'integration' }} | |
run: | | |
flytectl sandbox start --source . | |
flytectl config init | |
- name: Pytest | |
run: | | |
pytest tests/${{ matrix.test-dir }} | |
- name: Build Docs | |
# build error AttributeError: 'document' object has no attribute 'findall' | |
# in the furo theme, see: https://github.com/unionai-oss/unionml/runs/6786848582?check_suite_focus=true#step:8:2531 | |
# excluding docs build step from 3.7 for now. | |
if: ${{ matrix.python-version != '3.7' && matrix.test-dir == 'unit' }} | |
run: make docs |