Fix type checking tests #270
Workflow file for this run
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
--- | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
name: CI | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: | |
- '3.11' | |
- '3.10' | |
- '3.9' | |
# - '3.8' | |
# - '3.7' | |
name: Python ${{ matrix.python }} | |
steps: | |
# Python | |
- name: Setup python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
# Check out code | |
- uses: actions/checkout@v2 | |
# Cached dependencies | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-py${{ matrix.python }}-${{ hashFiles('**/requirements-dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-py${{ matrix.python }}- | |
- name: Install dev dependencies | |
run: pip install --requirement requirements-dev.txt | |
# Install library | |
- name: Install result | |
run: pip install --editable . | |
# Tests | |
- name: Run tests | |
run: pytest --ignore=tests/test_pattern_matching.py | |
- name: Run tests (pattern matching) | |
if: matrix.python == '3.10' || matrix.python == '3.11' | |
run: pytest tests/test_pattern_matching.py | |
# Linters | |
- name: Run flake8 (Python >= 3.10) | |
run: flake8 | |
if: matrix.python != '3.9' && matrix.python != '3.8' && matrix.python != '3.7' | |
- name: Run flake8 (Python < 3.10) | |
run: flake8 --extend-exclude tests/test_pattern_matching.py | |
if: matrix.python == '3.9' || matrix.python == '3.8' || matrix.python == '3.7' | |
- name: Run mypy | |
run: mypy | |
# Packaging | |
- name: Build packages | |
run: | | |
pip install --upgrade build pip setuptools wheel | |
python -m build | |
# Coverage | |
- name: Upload coverage to codecov.io | |
uses: codecov/codecov-action@v1 | |
if: matrix.python == '3.9' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |