Skip to content

Add fastapi prometheus example #20

Add fastapi prometheus example

Add fastapi prometheus example #20

name: Lint peripherals
on: pull_request
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
env:
POETRY_GROUPS: stress_test,code_quality,examples
jobs:
test:
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.11" ]
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: poetry install --no-interaction --with $POETRY_GROUPS -E uvloop
- name: Lint stress test code
run: make lint TARGET_DIR=stress_tests
- name: Lint tests code
run: make lint TARGET_DIR=tests
- name: Lint tests examples
run: make lint TARGET_DIR=examples