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