| 1 |
name: tests |
| 2 |
|
| 3 |
on: |
| 4 |
merge_group: |
| 5 |
push: |
| 6 |
branches-ignore: |
| 7 |
|
| 8 |
- gh-readonly-queue/** |
| 9 |
tags: |
| 10 |
|
| 11 |
- '**' |
| 12 |
pull_request: |
| 13 |
workflow_dispatch: |
| 14 |
|
| 15 |
permissions: |
| 16 |
contents: read |
| 17 |
|
| 18 |
env: |
| 19 |
|
| 20 |
FORCE_COLOR: 1 |
| 21 |
|
| 22 |
|
| 23 |
PIP_DISABLE_PIP_VERSION_CHECK: 'true' |
| 24 |
PIP_NO_PYTHON_VERSION_WARNING: 'true' |
| 25 |
PIP_NO_WARN_SCRIPT_LOCATION: 'true' |
| 26 |
|
| 27 |
|
| 28 |
TOX_OVERRIDE: >- |
| 29 |
testenv.pass_env+=GITHUB_*,FORCE_COLOR |
| 30 |
|
| 31 |
|
| 32 |
jobs: |
| 33 |
test: |
| 34 |
strategy: |
| 35 |
|
| 36 |
matrix: |
| 37 |
python: |
| 38 |
- "3.9" |
| 39 |
- "3.13" |
| 40 |
platform: |
| 41 |
- ubuntu-latest |
| 42 |
- macos-latest |
| 43 |
- windows-latest |
| 44 |
include: |
| 45 |
- python: "3.10" |
| 46 |
platform: ubuntu-latest |
| 47 |
- python: "3.11" |
| 48 |
platform: ubuntu-latest |
| 49 |
- python: "3.12" |
| 50 |
platform: ubuntu-latest |
| 51 |
- python: "3.14" |
| 52 |
platform: ubuntu-latest |
| 53 |
- python: pypy3.10 |
| 54 |
platform: ubuntu-latest |
| 55 |
- python: "3.x" |
| 56 |
platform: ubuntu-latest |
| 57 |
runs-on: ${{ matrix.platform }} |
| 58 |
continue-on-error: ${{ matrix.python == '3.14' }} |
| 59 |
steps: |
| 60 |
- uses: actions/checkout@v4 |
| 61 |
- name: Setup Python |
| 62 |
uses: actions/setup-python@v4 |
| 63 |
with: |
| 64 |
python-version: ${{ matrix.python }} |
| 65 |
allow-prereleases: true |
| 66 |
- name: Install tox |
| 67 |
run: python -m pip install tox |
| 68 |
- name: Run |
| 69 |
run: tox |
| 70 |
|
| 71 |
collateral: |
| 72 |
strategy: |
| 73 |
fail-fast: false |
| 74 |
matrix: |
| 75 |
job: |
| 76 |
- diffcov |
| 77 |
- docs |
| 78 |
runs-on: ubuntu-latest |
| 79 |
steps: |
| 80 |
- uses: actions/checkout@v4 |
| 81 |
with: |
| 82 |
fetch-depth: 0 |
| 83 |
- name: Setup Python |
| 84 |
uses: actions/setup-python@v4 |
| 85 |
with: |
| 86 |
python-version: 3.x |
| 87 |
- name: Install tox |
| 88 |
run: python -m pip install tox |
| 89 |
- name: Eval ${{ matrix.job }} |
| 90 |
run: tox -e ${{ matrix.job }} |
| 91 |
|
| 92 |
check: |
| 93 |
if: always() |
| 94 |
|
| 95 |
needs: |
| 96 |
- test |
| 97 |
- collateral |
| 98 |
|
| 99 |
runs-on: ubuntu-latest |
| 100 |
|
| 101 |
steps: |
| 102 |
- name: Decide whether the needed jobs succeeded or failed |
| 103 |
uses: re-actors/alls-green@release/v1 |
| 104 |
with: |
| 105 |
jobs: ${{ toJSON(needs) }} |
| 106 |
|
| 107 |
release: |
| 108 |
permissions: |
| 109 |
contents: write |
| 110 |
needs: |
| 111 |
- check |
| 112 |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 113 |
runs-on: ubuntu-latest |
| 114 |
|
| 115 |
steps: |
| 116 |
- uses: actions/checkout@v4 |
| 117 |
- name: Setup Python |
| 118 |
uses: actions/setup-python@v4 |
| 119 |
with: |
| 120 |
python-version: 3.x |
| 121 |
- name: Install tox |
| 122 |
run: python -m pip install tox |
| 123 |
- name: Run |
| 124 |
run: tox -e release |
| 125 |
env: |
| 126 |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 127 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |