Improve the contribution docs, add a test-sqlite make command and fix tox.ini errors #333
Workflow file for this run
This file contains 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: 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 | |
env: | |
TEST_DB_USER: "root" | |
TEST_DB_PASSWORD: "root" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Setup mysql | |
if: contains(matrix.name, 'mysql') | |
uses: shogo82148/actions-setup-mysql@v1 | |
with: | |
mysql-version: '8.0' | |
user: ${{ env.TEST_DB_USER }} | |
password: ${{ env.TEST_DB_PASSWORD }} | |
- name: Setup postgresql | |
if: contains(matrix.name, 'postgres') | |
uses: harmon758/postgresql-action@v1 | |
with: | |
postgresql version: '12' | |
postgresql user: ${{ env.TEST_DB_USER }} | |
postgresql password: ${{ env.TEST_DB_PASSWORD }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox==3.25.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: py37-dj32-sqlite-xdist-coverage | |
python: '3.7' | |
allow_failure: false | |
- name: py310-djmain-sqlite-coverage | |
python: '3.10' | |
allow_failure: true | |
- name: py37-dj32-mysql_myisam-coverage | |
python: '3.7' | |
allow_failure: false | |
# Explicitly test min pytest. | |
- name: py37-dj32-sqlite-pytestmin-coverage | |
python: '3.7' | |
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@v3 | |
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@0bf742be3ebe032c25dd15117957dc15d0cfc38d # v1.8.5 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} |