| 1 |
name: test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
- "test-me-*" |
| 8 |
|
| 9 |
pull_request: |
| 10 |
branches: |
| 11 |
- "*" |
| 12 |
|
| 13 |
# Cancel running jobs for the same workflow and branch. |
| 14 |
concurrency: |
| 15 |
group: ${{ github.workflow }}-${{ github.ref }} |
| 16 |
cancel-in-progress: true |
| 17 |
|
| 18 |
jobs: |
| 19 |
|
| 20 |
package: |
| 21 |
runs-on: ubuntu-latest |
| 22 |
steps: |
| 23 |
- uses: actions/checkout@v4 |
| 24 |
- name: Build and Check Package |
| 25 |
uses: hynek/[email protected] |
| 26 |
|
| 27 |
test: |
| 28 |
|
| 29 |
needs: [package] |
| 30 |
|
| 31 |
runs-on: ${{ matrix.os }} |
| 32 |
|
| 33 |
strategy: |
| 34 |
fail-fast: false |
| 35 |
matrix: |
| 36 |
tox_env: |
| 37 |
- "py39-pytestmin" |
| 38 |
- "py39-pytestlatest" |
| 39 |
- "py310-pytestlatest" |
| 40 |
- "py311-pytestlatest" |
| 41 |
- "py311-pytestmain" |
| 42 |
- "py312-pytestlatest" |
| 43 |
- "py313-pytestlatest" |
| 44 |
- "py310-psutil" |
| 45 |
- "py310-setproctitle" |
| 46 |
|
| 47 |
os: [ubuntu-latest, windows-latest] |
| 48 |
include: |
| 49 |
- tox_env: "py39-pytestmin" |
| 50 |
python: "3.9" |
| 51 |
- tox_env: "py39-pytestlatest" |
| 52 |
python: "3.9" |
| 53 |
- tox_env: "py310-pytestlatest" |
| 54 |
python: "3.10" |
| 55 |
- tox_env: "py311-pytestlatest" |
| 56 |
python: "3.11" |
| 57 |
- tox_env: "py311-pytestmain" |
| 58 |
python: "3.11" |
| 59 |
- tox_env: "py312-pytestlatest" |
| 60 |
python: "3.12" |
| 61 |
- tox_env: "py313-pytestlatest" |
| 62 |
python: "3.13" |
| 63 |
- tox_env: "py310-psutil" |
| 64 |
python: "3.10" |
| 65 |
- tox_env: "py310-setproctitle" |
| 66 |
python: "3.10" |
| 67 |
|
| 68 |
steps: |
| 69 |
- uses: actions/checkout@v4 |
| 70 |
with: |
| 71 |
# Needed to fetch tags, which are required by setuptools-scm. |
| 72 |
fetch-depth: 0 |
| 73 |
|
| 74 |
- name: Download Package |
| 75 |
uses: actions/download-artifact@v4 |
| 76 |
with: |
| 77 |
name: Packages |
| 78 |
path: dist |
| 79 |
|
| 80 |
- name: Set up Python |
| 81 |
uses: actions/setup-python@v5 |
| 82 |
with: |
| 83 |
python-version: ${{ matrix.python }} |
| 84 |
|
| 85 |
- name: Install tox |
| 86 |
run: | |
| 87 |
python -m pip install --upgrade pip |
| 88 |
pip install tox |
| 89 |
|
| 90 |
- name: Test |
| 91 |
shell: bash |
| 92 |
run: | |
| 93 |
tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz` |