Skip to content

test

test #1681

Workflow file for this run

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]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
experimental: [false]
build: ['']
include:
# As the experimental task for the dev version.
- os: ubuntu-latest
python: "3.13-dev"
experimental: true
build: 'free-threading'
- os: ubuntu-latest
python: "3.14-dev"
experimental: true
- os: ubuntu-latest
python: "3.14-dev"
experimental: true
build: 'free-threading'
# Also test PyPy, macOS, and Windows:
- os: ubuntu-latest
python: pypy-3.10
experimental: false
- os: ubuntu-latest
python: pypy-3.9
experimental: false
- os: macos-latest
python: "3.13"
experimental: true
- os: windows-latest
python: "3.13"
experimental: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
if: "!endsWith(matrix.python, '-dev')"
with:
python-version: ${{ matrix.python }}
- name: Set up Python ${{ matrix.python }} using deadsnakes
uses: deadsnakes/[email protected]
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 }}