Improve the contribution docs, add a test-sqlite make command and fix tox.ini errors #336
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: "test" | |
TEST_DB_PASSWORD: "test" | |
services: | |
mysql: | |
image: mysql:5.7 | |
ports: | |
- 33306:3306 | |
env: | |
MYSQL_USER: ${{ env.TEST_DB_USER }} | |
MYSQL_PASSWORD: ${{ env.TEST_DB_PASSWORD }} | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
postgres: | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: ${{ env.TEST_DB_USER }} | |
POSTGRES_PASSWORD: ${{ env.TEST_DB_PASSWORD }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- 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 }} |