# ===============================================================
# 🔄 Async Safety & Performance Testing
# ===============================================================
#
# - runs the async safety and performance tests across multiple Python versions
# - includes linting, debugging, profiling, benchmarking, and validation
# - uploads the test artifacts as build artifacts
# - performs a performance regression check
# ---------------------------------------------------------------
name: Tests & Coverage
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
# schedule:
# - cron: '42 3 * * 1' # Monday 03:42 UTC
permissions:
contents: write # needed *only* if the badge-commit step is enabled
checks: write
actions: read
jobs:
async-testing:
name: 🔄 Async Safety & Performance Testing
runs-on: ubuntu-latest
needs: [test]
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12"]
steps:
- name: ⬇️ Checkout source
uses: actions/checkout@v5
with:
fetch-depth: 1
- name: 🐍 Setup Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install flake8-async flake8-bugbear pytest-asyncio snakeviz aiomonitor
- name: 🔍 Run async linting
run: |
make async-lint
- name: 🐛 Run async debug tests
run: |
make async-debug
- name: 📊 Generate performance profiles
run: |
make profile
- name: ⚡ Run async benchmarks
run: |
make async-benchmark
- name: ✅ Validate async patterns
run: |
make async-validate
- name: 📎 Upload async test artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: async-test-results
path: |
tests/async/reports/
tests/async/profiles/
retention-days: 30
- name: 📈 Performance regression check
run: |
python tests/async/check_regression.py \
--current tests/async/profiles/latest.prof \
--baseline tests/async/profiles/baseline.prof \
--threshold 20 # 20% regression threshold