add uv installation and CI (#359) #908
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow installs Python dependencies and runs tests using uv | |
| name: Python application | |
| on: | |
| push: | |
| branches: [ "main", "dev" ] | |
| paths-ignore: | |
| - "docs/**" | |
| - "**/README.md" | |
| pull_request: | |
| branches: [ "main", "dev" ] | |
| paths-ignore: | |
| - "docs/**" | |
| - "**/README.md" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| build: | |
| env: | |
| DISPLAY: :0 | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| steps: | |
| - name: Set environment variable for macOS | |
| if: ${{ runner.os == 'macOS' }} | |
| run: echo "SYSTEM_VERSION_COMPAT=0" >> $GITHUB_ENV | |
| - name: Checkout repository and submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Create virtual environment | |
| run: | | |
| uv venv --python 3.10 | |
| - name: Prepare Linux | |
| if: ${{ runner.os == 'Linux' }} | |
| run: | | |
| sudo apt-get update -y -qq | |
| sudo apt-get install -y xvfb x11-xserver-utils ffmpeg | |
| sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & | |
| - name: Install project dependencies | |
| run: | | |
| uv pip install -e . | |
| uv pip install ffmpeg scikit-video | |
| - name: Run MuJoCo Rendering test | |
| if: ${{ runner.os == 'Linux' }} | |
| run: uv run python -m mujoco.render_test | |
| - name: Test myoapi | |
| run: uv run python -m myosuite.tests.test_myoapi | |
| - name: Run Test environment | |
| run: uv run python -m myosuite.tests.test_myo | |
| - name: Test rendering | |
| if: ${{ runner.os == 'Linux' }} | |
| run: uv run python -m myosuite.utils.examine_env -e myoElbowPose1D6MRandom-v0 -r offscreen -n 1 | |
| - name: Run Test jupyter-notebooks tutorials | |
| if: ${{ runner.os == 'Linux' }} | |
| run: | | |
| source myosuite/tests/test_tutorials.sh | |
| - name: Run Test gym/gymnasium + stable-baselines3 | |
| if: ${{ runner.os == 'Linux' }} | |
| run: | | |
| source myosuite/tests/test_versions.sh |