Skip to content

Format code with Ruff #375

Format code with Ruff

Format code with Ruff #375

Workflow file for this run

name: main
on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- master
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@v4
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@v3
with:
fail_ci_if_error: true
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- name: linting,docs
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@v4
with:
python-version: '3.11'
- 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@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
with:
user: __token__
password: ${{ secrets.pypi_token }}