Skip to content

Rebind instance method fixtures to the same instance as the test #1110

Rebind instance method fixtures to the same instance as the test

Rebind instance method fixtures to the same instance as the test #1110

Workflow file for this run

name: test suite
on:
push:
branches: [master]
pull_request:
jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
workflow-changed: ${{ steps.changed-files.outputs.workflow_any_changed }}
pyproject-changed: ${{ steps.changed-files.outputs.src_any_changed }}
src-changed: ${{ steps.changed-files.outputs.src_any_changed }}
tests-changed: ${{ steps.changed-files.outputs.tests_any_changed }}
docs-changed: ${{ steps.changed-files.outputs.doc_any_changed }}
steps:
- uses: actions/checkout@v4
- name: Get changed files by category
id: changed-files
uses: tj-actions/changed-files@v41
with:
files_yaml: |
workflow:
- .github/workflows/test.yml
pyproject:
- pyproject.toml
src:
- src/**
tests:
- tests/**
doc:
- README.rst
- docs/**
pyright:
runs-on: ubuntu-latest
needs: changed-files
if: |
${{
(needs.changed-files.outputs.workflow-changed == 'true')
|| (needs.changed-files.outputs.src-changed == 'true')
}}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-pyright
- name: Install dependencies
run: pip install -e . pyright pytest
- name: Run pyright
run: pyright --verifytypes anyio
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.10]
include:
- os: macos-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.13"
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.13"
runs-on: ${{ matrix.os }}
needs: changed-files
if: |
${{
(needs.changed-files.outputs.workflow-changed == 'true')
|| (needs.changed-files.outputs.pyproject-changed == 'true')
|| (needs.changed-files.outputs.src-changed == 'true')
|| (needs.changed-files.outputs.tests-changed == 'true')
}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e .[test]
- name: Test with pytest
run: coverage run -m pytest -v
timeout-minutes: 5
env:
PYTEST_DISABLE_PLUGIN_AUTOLOAD: 1
- name: Generate coverage report
run: coverage xml
- name: Upload Coverage
uses: coverallsapp/github-action@v2
with:
parallel: true
file: coverage.xml
docs:
runs-on: ubuntu-latest
needs: changed-files
if: |
${{
(needs.changed-files.outputs.workflow-changed == 'true')
|| (needs.changed-files.outputs.pyproject-changed == 'true')
|| (needs.changed-files.outputs.src-changed == 'true')
|| (needs.changed-files.outputs.docs-changed == 'true')
}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e .[doc]
- name: Build documentation
run: sphinx-build -W docs build/sphinx
coveralls:
name: Finish Coveralls
needs: test
runs-on: ubuntu-latest
steps:
- name: Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true