Skip to content

Update dependencies, actions, and pre-commit hooks #984

Update dependencies, actions, and pre-commit hooks

Update dependencies, actions, and pre-commit hooks #984

Workflow file for this run

name: Build
on:
push:
branches: [main]
tags: ['*']
pull_request:
branches: [main]
workflow_dispatch:
env:
LATEST_PY_VERSION: '3.14'
COVERAGE_ARGS: '--cov --cov-report=term --cov-report=xml'
XDIST_ARGS: '--numprocesses=auto --dist=loadfile'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.14'
- '3.13'
- '3.12'
- '3.11'
- '3.10'
- '3.9'
services:
httpbin:
image: mccutchen/go-httpbin
ports:
- 8080:8080
steps:
# Install dependencies, with caching
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install dependencies
run: |
uv python install ${{ matrix.python-version }}
uv sync --all-extras --group test-server
# Start integration test databases
- uses: supercharge/mongodb-github-action@315db7fe45ac2880b7758f1933e6e5d59afd5e94 # 1.12.1
with:
mongodb-version: '5.0'
- uses: supercharge/redis-github-action@v2
with:
redis-version: '6'
- uses: rrainn/dynamodb-action@36eaff1005b37a22258716d4280f9e0377b834aa # v4.0.0
- name: Run custom test server
run: |
cd test && uv run gunicorn -D -c server/gunicorn-cfg.py server:app
# Run tests with coverage report
- name: Run tests
run: |
uv run pytest -rs test/unit ${{ env.XDIST_ARGS }} ${{ env.COVERAGE_ARGS }}
uv run pytest -rs test/integration --cov-append ${{ env.XDIST_ARGS }} ${{ env.COVERAGE_ARGS }}
# Latest python version: send coverage report to codecov
- name: 'Upload coverage report to Codecov'
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
# Run code analysis checks
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- name: Run style checks & linting
uses: j178/prek-action@4e14d07f9231acabce116ccfca13b13dd9755ece # v3.0.0
- name: Scan dependencies for known vulnerabilities
uses: pypa/gh-action-pip-audit@1220774d901786e6f652ae159f7b6bc8fea6d266 # v1.1.0
with:
inputs: .
vulnerability-service: osv