Skip to content

tox: update ruff, mypy #473

tox: update ruff, mypy

tox: update ruff, mypy #473

Workflow file for this run

name: main
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
env:
PYTEST_ADDOPTS: "--color=yes"
# Set permissions at the job level.
permissions: {}
jobs:
test:
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.allow_failure }}
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup mysql
if: contains(matrix.name, 'mysql')
run: |
sudo systemctl start mysql.service
echo "TEST_DB_USER=root" >> $GITHUB_ENV
echo "TEST_DB_PASSWORD=root" >> $GITHUB_ENV
- name: Setup postgresql
if: contains(matrix.name, 'postgres')
run: |
sudo systemctl start postgresql.service
sudo -u postgres createuser --createdb $USER
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==4.11.1
- name: Run tox
run: tox -e ${{ matrix.name }}
- name: Report coverage
if: contains(matrix.name, 'coverage')
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- name: linting,docs
python: '3.12'
allow_failure: false
- name: py312-dj50-postgres-xdist-coverage
python: '3.12'
allow_failure: false
- name: py311-dj50-postgres-xdist-coverage
python: '3.11'
allow_failure: false
- name: py311-dj42-postgres-xdist-coverage
python: '3.11'
allow_failure: false
- name: py310-dj41-postgres-xdist-coverage
python: '3.10'
allow_failure: false
- name: py310-dj32-postgres-xdist-coverage
python: '3.10'
allow_failure: false
- name: py311-dj41-mysql_innodb-coverage
python: '3.11'
allow_failure: false
- name: py310-dj42-mysql_innodb-coverage
python: '3.10'
allow_failure: false
- name: py39-dj32-mysql_innodb-xdist-coverage
python: '3.9'
allow_failure: false
- name: py38-dj41-sqlite-xdist-coverage
python: '3.8'
allow_failure: false
- name: py38-dj32-sqlite-xdist-coverage
python: '3.8'
allow_failure: false
- name: py310-djmain-sqlite-coverage
python: '3.10'
allow_failure: true
- name: py38-dj32-mysql_myisam-coverage
python: '3.8'
allow_failure: false
# Explicitly test min pytest.
- name: py38-dj32-sqlite-pytestmin-coverage
python: '3.8'
allow_failure: false
# pypy3: not included with coverage reports (much slower then).
- name: pypy3-dj32-postgres
python: 'pypy3.9'
allow_failure: false
deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest-django'
runs-on: ubuntu-22.04
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@8a08d616893759ef8e1aa1f2785787c0b97e20d6 # v1.10.0
with:
user: __token__
password: ${{ secrets.pypi_token }}