Skip to content

Fixes Non-Deterministic Tests (#1295) #190

Fixes Non-Deterministic Tests (#1295)

Fixes Non-Deterministic Tests (#1295) #190

Workflow file for this run

name: Install CI
on:
push:
branches: [main]
pull_request:
branches: [main, v2.0-refactor]
schedule:
- cron: '0 6 * * *' # 6 AM UTC daily
workflow_dispatch: # Allows manual triggering from GitHub UI
merge_group:
jobs:
test-pip:
name: Test with pip (Python ${{ matrix.python-version }}, OS ${{ matrix.os }})
runs-on: ${{ matrix.os }}
# Only run pip tests for scheduled and manual dispatch jobs
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ${{ github.event_name == 'pull_request' && fromJSON('["3.12"]') || fromJSON('["3.11","3.12","3.13"]') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package with pip
run: |
python -m pip install --upgrade pip
# pip 25.1+ supports dependency groups natively via --group
pip install -e . --group dev
- name: Run tests
run: |
pytest test/
test-uv:
name: Test with uv (Python ${{ matrix.python-version }}, OS ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# For push/PR/merge_group: only ubuntu. For schedule/manual: full matrix
os: ${{ (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'merge_group') && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest","macos-latest"]') }}
python-version: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && fromJSON('["3.12"]') || fromJSON('["3.11","3.12","3.13"]') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: nick-fields/retry@v3
# uv download can be flaky. Wrapping in a retry:
with:
timeout_minutes: 5
max_attempts: 3
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install package with uv
run: |
# Install core dependencies and development group
UV_PREVIEW=1 uv sync --group dev --preview-features extra-build-dependencies
- name: Run tests
run: |
uv run pytest test/