--- name: Run Tests # yamllint disable-line rule:truthy on: push: branches: - master pull_request: branches: - master release: types: - released jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - uses: pre-commit/action@v3.0.1 with: extra_args: -a tests: runs-on: ubuntu-latest strategy: fail-fast: false matrix: django-version: - 4.2.* - 5.0.* - 5.1.* - 5.2.* python-version: - '3.10' - '3.11' - '3.12' - '3.13' - '3.14' exclude: # Django 4.2 only supports python 3.8-3.12 - django-version: 4.2.* python-version: '3.13' - django-version: 4.2.* python-version: '3.14' # Django 5.0 only supports python 3.10-3.12 - django-version: 5.0.* python-version: '3.13' - django-version: 5.0.* python-version: '3.14' # Django 5.1 only supports python 3.10-3.13 - django-version: 5.1.* python-version: '3.14' # Django 5.2 only supports python 3.10-3.13 (assuming) - django-version: 5.2.* python-version: '3.14' steps: - name: Checkout uses: actions/checkout@v4 - name: Install Poetry run: pipx install poetry - name: Set up Python ${{ matrix.python-version }} id: setup-python uses: actions/setup-python@v5 with: cache: poetry python-version: ${{ matrix.python-version }} - name: Install Deps run: poetry install - name: Install Django ${{ matrix.django-version }} run: poetry run pip install "django==${{ matrix.django-version }}" - name: Test with pytest run: poetry run pytest --showlocals -vvv --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} publish: runs-on: ubuntu-latest needs: - lint - tests if: > needs.lint.result == 'success' && needs.tests.result == 'success' && github.event.action == 'released' steps: - uses: actions/checkout@v4 - name: Build and publish to pypi uses: JRubics/poetry-publish@v2.0 with: pypi_token: ${{ secrets.PYPI_TOKEN }}