1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
# -- SOURCE: https://github.com/marketplace/actions/setup-python
# SEE: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
# SUPPORTED PYTHON VERSIONS: https://github.com/actions/python-versions
name: test
on:
workflow_dispatch:
push:
branches: [ "main", "release/**" ]
pull_request:
types: [opened, reopened, review_requested]
branches: [ "main" ]
jobs:
test:
# -- EXAMPLE: runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# PREPARED: os: [ubuntu-latest, macos-latest, windows-latest]
# DISABLED: os: [ubuntu-latest, windows-latest]
python-version: ["3.13", "3.12", "3.11", "3.10"]
# -- PREPARED FOR: Experimental Python versions with "continue-on-error".
experimental: [false]
include:
- python-version: "3.14.0-rc.1"
experimental: true
# -- DISABLED:
# exclude:
# - os: windows-latest
# python-version: "2.7"
# DISABLED: runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v5
# DISABLED: name: Setup Python ${{ matrix.python-version }} on platform=${{ matrix.os }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# DISABLED: cache: 'pip'
# DISABLED: cache-dependency-path: 'py.requirements/*.txt'
# -- DISABLED:
# - name: Show Python version
# run: python --version
- name: setup-uv -- Speed-up Python package installations ...
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/py.requirements/ci.github.testing.txt
**/py.requirements/basic.txt
**/py.requirements/testing.txt
- name: "Install Python package dependencies (with: uv)"
run: |
uv pip install --system -U pip setuptools wheel
uv pip install --system -U -r py.requirements/ci.github.testing.txt
uv pip install --system -e .
- name: Run tests
run: pytest
- name: Upload test reports
uses: actions/upload-artifact@v4
with:
name: test reports
path: |
build/testing/report.xml
build/testing/report.html
if: ${{ job.status == 'failure' }}
# MAYBE: if: ${{ always() }}
|