|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +jobs: |
| 9 | + flake8_lint: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - name: Set up Python |
| 14 | + uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: '3.9' |
| 17 | + - name: Install tox |
| 18 | + run: pip install tox |
| 19 | + - name: Run flake8 |
| 20 | + run: tox -e flake8 |
| 21 | + |
| 22 | + isort_lint: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - name: Set up Python |
| 27 | + uses: actions/setup-python@v5 |
| 28 | + with: |
| 29 | + python-version: '3.9' |
| 30 | + - name: Install tox |
| 31 | + run: pip install tox |
| 32 | + - name: Run isort |
| 33 | + run: tox -e isort |
| 34 | + |
| 35 | + mypy_lint: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - name: Set up Python |
| 40 | + uses: actions/setup-python@v5 |
| 41 | + with: |
| 42 | + python-version: '3.9' |
| 43 | + - name: Install tox |
| 44 | + run: pip install tox |
| 45 | + - name: Run mypy |
| 46 | + run: tox -e mypy |
| 47 | + |
| 48 | + test: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + strategy: |
| 51 | + matrix: |
| 52 | + python-version: ['3.9.18', '3.10', '3.11', '3.12', '3.13', '3.14'] |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - name: Set up Python ${{ matrix.python-version }} |
| 56 | + uses: actions/setup-python@v5 |
| 57 | + with: |
| 58 | + python-version: ${{ matrix.python-version }} |
| 59 | + - name: Install dependencies |
| 60 | + run: | |
| 61 | + pip install --user tox "virtualenv<20.22.0" |
| 62 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 63 | + - name: Set tox environment |
| 64 | + id: toxenv |
| 65 | + run: | |
| 66 | + VERSION="${{ matrix.python-version }}" |
| 67 | + # Extract major.minor version (strip patch if present) |
| 68 | + TOX_VERSION=$(echo "$VERSION" | cut -d. -f1,2) |
| 69 | + echo "toxenv=py${TOX_VERSION}" >> $GITHUB_OUTPUT |
| 70 | + - name: Run tests |
| 71 | + run: tox |
| 72 | + env: |
| 73 | + TOXENV: ${{ steps.toxenv.outputs.toxenv }} |
| 74 | + |
| 75 | + test_nooptionals: |
| 76 | + runs-on: ubuntu-latest |
| 77 | + strategy: |
| 78 | + matrix: |
| 79 | + python-version: ['3.9'] |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v4 |
| 82 | + - name: Set up Python ${{ matrix.python-version }} |
| 83 | + uses: actions/setup-python@v5 |
| 84 | + with: |
| 85 | + python-version: ${{ matrix.python-version }} |
| 86 | + - name: Install tox |
| 87 | + run: pip install tox |
| 88 | + - name: Run tests without optional dependencies |
| 89 | + run: tox |
| 90 | + env: |
| 91 | + TOXENV: py${{ matrix.python-version }}-nooptionals |
| 92 | + |
| 93 | + test_pypy: |
| 94 | + runs-on: ubuntu-latest |
| 95 | + strategy: |
| 96 | + matrix: |
| 97 | + pypy-version: ['3.9'] |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v4 |
| 100 | + - name: Set up PyPy ${{ matrix.pypy-version }} |
| 101 | + uses: actions/setup-python@v5 |
| 102 | + with: |
| 103 | + python-version: pypy-${{ matrix.pypy-version }} |
| 104 | + - name: Install tox |
| 105 | + run: pip install tox |
| 106 | + - name: Run tests with PyPy |
| 107 | + run: tox |
| 108 | + env: |
| 109 | + TOXENV: pypy${{ matrix.pypy-version }} |
0 commit comments