| 1 | name: Testing |
| 2 | on: |
| 3 | push: |
| 4 | branches: [main] |
| 5 | pull_request: |
| 6 | branches: [main] |
| 7 | env: |
| 8 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 9 | jobs: |
| 10 | test: |
| 11 | name: Testing on |
| 12 | runs-on: "ubuntu-latest" |
| 13 | strategy: |
| 14 | matrix: |
| 15 | python-version: ["3.14", "3.13", "3.12", "3.11", "3.10", "pypy-3.10"] |
| 16 | steps: |
| 17 | - uses: actions/checkout@v4 |
| 18 | - name: Set up Python |
| 19 | uses: actions/setup-python@v5 |
| 20 | with: |
| 21 | python-version: ${{ matrix.python-version }} |
| 22 | - name: Cache packages |
| 23 | uses: actions/cache@v4 |
| 24 | with: |
| 25 | path: ~/.cache/pip |
| 26 | key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }} |
| 27 | restore-keys: | |
| 28 | ${{ runner.os }}-pip-${{ matrix.python-version }}- |
| 29 | - name: Install dependencies |
| 30 | run: python -m pip install tox |
| 31 | - name: Test |
| 32 | run: tox -e test |
| 33 | |
| 34 | lint: |
| 35 | name: Lint code |
| 36 | runs-on: "ubuntu-latest" |
| 37 | strategy: |
| 38 | matrix: |
| 39 | python-version: ["3.13"] |
| 40 | steps: |
| 41 | - uses: actions/checkout@v4 |
| 42 | - name: Set up Python |
| 43 | uses: actions/setup-python@v5 |
| 44 | with: |
| 45 | python-version: ${{ matrix.python-version }} |
| 46 | - name: Cache packages |
| 47 | uses: actions/cache@v4 |
| 48 | with: |
| 49 | path: | |
| 50 | ~/.cache/pre-commit |
| 51 | ~/.cache/pip |
| 52 | key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }} |
| 53 | restore-keys: | |
| 54 | ${{ runner.os }}-pip-${{ matrix.python-version }}- |
| 55 | - name: Install dependencies |
| 56 | run: python -m pip install tox |
| 57 | - name: Run linting |
| 58 | run: tox -e lint |