Add fastapi helper middleware for pretty coroutine names #31
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 | |
on: pull_request | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
env: | |
POETRY_GROUPS: code_quality | |
jobs: | |
test: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ "ubuntu-latest" ] | |
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Create poetry groups cache key | |
id: create-poetry-groups-cache-key | |
run: | | |
echo poetry_groups_cache_key='${{ env.POETRY_GROUPS }}' | sed 's/,/-/g' >> $GITHUB_OUTPUT | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ steps.create-poetry-groups-cache-key.outputs.poetry_groups_cache_key }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: make install POETRY_GROUPS=$POETRY_GROUPS | |
- name: Lint code | |
run: make lint TARGET_DIR=monitored_ioloop | |
- name: Run tests | |
run: | | |
poetry run pytest tests -n auto --junitxml=test-results.xml --cov=monitored_ioloop --cov-report=xml | |
- name: Pytest coverage comment | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-xml-coverage-path: ./coverage.xml | |
unique-id-for-comment: pytest-coverage-report | |
title: Pytest coverage report | |
junitxml-path: ./test-results.xml | |
junitxml-title: Pytest test summary |