Update and move to Wagtail Nest #34
This file contains hidden or 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: Test & Lint | |
| # Inspired by https://github.com/wagtail/wagtail-bakery/blob/0bfff2a7446e6119156279d22cfac2137960145d/.github/workflows/test.yml | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_call: # Allow for the publish workflows to run the tests by calling this workflow | |
| jobs: | |
| pre-commit: | |
| name: Pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Run pre-commit | |
| run: | | |
| python -m pip install pre-commit | |
| pre-commit install | |
| pre-commit run --all-files | |
| test: | |
| name: Python ${{ matrix.python}} ${{ matrix.toxenv }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install tox coverage | |
| - name: Run tox targets for Python ${{ matrix.python }} | |
| run: | | |
| # Run only the tox environments that match the Python version | |
| tox run -f py$(echo ${{ matrix.python }} | tr -d .) | |
| coverage combine | |
| coverage report | |
| # Codecov does not support the .coverage file generated by coverage, so we convert it to xml | |
| coverage xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |