Skip to content

Version v2.1.1

Version v2.1.1 #245

Workflow file for this run

name: Tests
on:
push:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test-core:
name: Core tests (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Full version sweep on Linux; only the newest supported Python on
# macOS and Windows.
include:
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.13"
- os: ubuntu-latest
python-version: "3.14"
- os: macos-latest
python-version: "3.14"
- os: windows-latest
python-version: "3.14"
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install EGL/Mesa dependencies (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libegl1-mesa-dev libgles2-mesa-dev libosmesa6-dev ffmpeg
- name: Install Python dependencies
# rl is its own extra (not pulled in by dev) so the muscle-imitation
# tests can run in CI; the GPU-only `warp` group is still excluded and
# deselected via `-m "not warp"` below.
run: uv sync --extra dev --extra examples --extra rl
# The high-resolution meshes (FlyBody + fullsize NeuroMechFly + the FlyMimic
# musculoskeletal body) are not shipped with the package;
# flygym.utils.assets_lazy_loading downloads them from S3 on first use.
# actions/cache persists this directory in GitHub's cache storage across
# runs (the runner VM is ephemeral, the cache is not), so we only download
# ~150 MB once per cache key. Default cache root is ~/.cache/flygym_assets
# on all runners.
- name: Cache FlyGym remote assets
uses: actions/cache@v4
with:
path: ~/.cache/flygym_assets
key: flygym-assets-${{ runner.os }}-v1
- name: Run tests
env:
# mujoco hardcodes CGL on macOS and GLFW on Windows; neither can create
# a headless OpenGL context on GitHub-hosted runners (no GPU), so skip
# rendering tests there. Linux uses EGL/Mesa and runs them.
SKIP_RENDERING_TESTS: ${{ runner.os == 'Linux' && '0' || '1' }}
# Collect the whole tree but use marker selection (not directory
# selection) to drop the groups CI can't run: warp needs a CUDA GPU.
# Rendering tests are gated separately via SKIP_RENDERING_TESTS above.
run: uv run pytest tests/ -m "not warp" -v --tb=short