Enable postponed evaluation of annotations everywhere #72
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: Tests | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
code-quality: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install Poetry | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: poetry | |
- name: Update PATH | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install | |
# Ruff | |
- name: Ruff / Linter | |
run: poetry run ruff check . --output-format github | |
- name: Ruff / Formatter | |
if: ${{ success() || failure() }} | |
run: poetry run ruff format --check . | |
# mypy for Linux | |
- name: mypy / Linux / 3.8 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.8 --platform linux | |
- name: mypy / Linux / 3.9 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.9 --platform linux | |
- name: mypy / Linux / 3.10 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.10 --platform linux | |
- name: mypy / Linux / 3.11 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.11 --platform linux | |
# mypy for macOS | |
- name: mypy / macOS / 3.8 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.8 --platform darwin | |
- name: mypy / macOS / 3.9 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.9 --platform darwin | |
- name: mypy / macOS / 3.10 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.10 --platform darwin | |
- name: mypy / macOS / 3.11 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.11 --platform darwin | |
# mypy for Windows | |
- name: mypy / Windows / 3.8 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.8 --platform win32 | |
- name: mypy / Windows / 3.9 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.9 --platform win32 | |
- name: mypy / Windows / 3.10 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.10 --platform win32 | |
- name: mypy / Windows / 3.11 | |
if: ${{ success() || failure() }} | |
run: poetry run mypy . --python-version 3.11 --platform win32 | |
tests: | |
strategy: | |
matrix: | |
os: ['Linux', 'macOS', 'Windows'] | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
include: | |
- os: Linux | |
image: ubuntu-latest | |
- os: macOS | |
image: macos-latest | |
- os: Windows | |
image: windows-latest | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.image }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install Poetry | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: poetry | |
- name: Update PATH | |
if: ${{ matrix.os != 'Windows' }} | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Update PATH (Windows) | |
if: ${{ matrix.os == 'Windows' }} | |
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install | |
- name: Install pytest annotation plugin | |
run: poetry run pip install pytest-github-actions-annotate-failures | |
- name: Run tests with coverage | |
if: ${{ matrix.os != 'Linux' }} | |
run: poetry run pytest --cov | |
- name: Run tests with coverage (Linux) | |
if: ${{ matrix.os == 'Linux' }} | |
run: sudo -E env "PATH=$PATH" poetry run pytest --cov | |
- name: Upload coverage data to Coveralls | |
run: poetry run coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |