Add test suite #11
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
name: Test Suite | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }} (Uvicorn ${{ matrix.uvicorn-version }}/Gunicorn ${{ matrix.gunicorn-version }})" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.8", "3.9", "3.10", "3.12"] | |
uvicorn-version: ["0.14.0", "latest"] | |
gunicorn-version: ["20.1.0", "latest"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: Install dependencies | |
run: | | |
scripts/install | |
if [ "$UVICORN_VERSION" != "latest" ]; then | |
echo "Uvicorn version is not the latest. Installing specified version..." | |
pip install uvicorn==$UVICORN_VERSION | |
fi | |
if [ "$GUNICORN_VERSION" != "latest" ]; then | |
echo "Gunicorn version is not the latest. Installing specified version..." | |
pip install gunicorn==$GUNICORN_VERSION | |
fi | |
env: | |
UVICORN_VERSION: ${{ matrix.uvicorn-version }} | |
GUNICORN_VERSION: ${{ matrix.gunicorn-version }} | |
- name: Run linting checks | |
run: scripts/check | |
- name: Build package | |
run: scripts/build | |
- name: Run tests | |
run: scripts/test | |
timeout-minutes: 10 | |
- name: Enforce coverage | |
run: scripts/coverage |