Skip to content

GEP 10: Units and Dimensionality (draft) #249

GEP 10: Units and Dimensionality (draft)

GEP 10: Units and Dimensionality (draft) #249

Workflow file for this run

---
name: main
# Automatically cancel a previous run.
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
run-tests:
name: Run tests for ${{ matrix.os }} on ${{ matrix.environment }}
runs-on: ${{ matrix.os }}
# Run CI with both package-wide beartype claws on (gettsim transitively
# exercises ttsim, so we want violations on either side to surface).
# The claws are on by default (GEP 9, Option A; see each package's
# `__init__.py`); set the env vars to 0 to opt out. We set them
# explicitly here so CI exercises the claws even if the default ever
# changes.
env:
GETTSIM_BEARTYPE_CLAW: '1'
TTSIM_BEARTYPE_CLAW: '1'
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
environment:
- py311
- py312
- py313
- py314
- py314-jax
exclude:
- os: macos-latest
environment: py311
- os: macos-latest
environment: py312
- os: macos-latest
environment: py313
- os: windows-latest
environment: py311
- os: windows-latest
environment: py312
- os: windows-latest
environment: py313
steps:
- uses: actions/checkout@v6
- uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.70.1
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
frozen: true
environments: ${{ matrix.environment }}
- name: Run tests on Linux (with NumPy backend and without coverage)
if: >-
matrix.environment == 'py311' ||
matrix.environment == 'py312' ||
matrix.environment == 'py313'
run: pixi run --locked -e ${{ matrix.environment }} tests
shell: bash -el {0}
- name: Run tests on Linux (with NumPy backend and coverage)
if: runner.os == 'Linux' && matrix.environment == 'py314'
run: pixi run --locked tests-with-cov
shell: bash -el {0}
- name: Run tests on MacOS / Windows (with NumPy backend and without coverage)
if: runner.os != 'Linux'
run: pixi run --locked -e ${{ matrix.environment }} tests
shell: bash -el {0}
- name: Run tests with JAX backend
if: matrix.environment == 'py314-jax'
run: pixi run --locked -e ${{ matrix.environment }} tests-jax
shell: bash -el {0}
- name: Upload coverage reports
if: runner.os == 'Linux' && matrix.environment == 'py314'
uses: codecov/codecov-action@v6.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
run-ty:
name: Run ty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: prefix-dev/setup-pixi@v0.9.6
with:
pixi-version: v0.70.1
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
frozen: true
environments: py314 py314-jax
- name: Run ty (numpy backend)
run: pixi run --locked -e py314 prek run ty --all-files
shell: bash -el {0}
- name: Run ty (jax backend)
run: pixi run --locked -e py314 prek run ty-jax --all-files
shell: bash -el {0}