|
name: test |
|
|
|
on: |
|
push: |
|
pull_request: |
|
schedule: |
|
# Midnight UTC: |
|
- cron: "0 0 * * *" |
|
workflow_dispatch: |
|
|
|
jobs: |
|
|
|
test: |
|
runs-on: ${{ matrix.os }} |
|
permissions: |
|
pull-requests: write |
|
name: ${{ matrix.os }} - ${{ matrix.python }} ${{ matrix.build }} |
|
if: ${{ github.event_name != 'schedule' || (github.repository == 'python/pyperformance' && github.event_name == 'schedule') }} |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
# Test all supported versions on Ubuntu: |
|
os: [ubuntu-latest, ubuntu-24.04-arm] |
|
python: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
|
experimental: [false] |
|
build: [''] |
|
include: |
|
# As the experimental task for the dev version. |
|
- os: ubuntu-latest |
|
python: "3.14" |
|
experimental: true |
|
build: 'free-threading' |
|
- os: ubuntu-24.04-arm |
|
python: "3.14" |
|
experimental: true |
|
build: 'free-threading' |
|
- os: ubuntu-latest |
|
python: "3.15-dev" |
|
experimental: true |
|
- os: ubuntu-latest |
|
python: "3.15-dev" |
|
experimental: true |
|
build: 'free-threading' |
|
# Also test PyPy, macOS, and Windows: |
|
- os: ubuntu-latest |
|
python: pypy-3.11 |
|
experimental: false |
|
- os: macos-latest |
|
python: "3.14" |
|
experimental: true |
|
- os: windows-latest |
|
python: "3.14" |
|
experimental: false |
|
steps: |
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
persist-credentials: false |
|
- name: Set up Python ${{ matrix.python }} |
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
|
if: "!endsWith(matrix.python, '-dev')" |
|
with: |
|
python-version: ${{ matrix.python }} |
|
- name: Set up Python ${{ matrix.python }} using deadsnakes |
|
uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0 |
|
if: "endsWith(matrix.python, '-dev')" |
|
with: |
|
python-version: ${{ matrix.python }} |
|
nogil: ${{ matrix.build == 'free-threading' }} |
|
- name: Install |
|
# pyperformance must be installed: |
|
# pyperformance/tests/test_compare.py imports it |
|
run: | |
|
python -m pip install --upgrade pip setuptools |
|
python -m pip install -e . |
|
- name: Display Python version |
|
run: | |
|
python -VV |
|
python -c 'import sysconfig; print("Free threading?", "Yes" if sysconfig.get_config_var("Py_GIL_DISABLED") else "No")' |
|
- name: Run Tests |
|
id: pyperformance |
|
run: python -u -m pyperformance.tests |
|
continue-on-error: ${{ matrix.experimental }} |