ci: auto-trigger release on push to release branch #20
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install ruff | |
| - name: Ruff lint | |
| run: ruff check . | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package with dev dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Run tests | |
| run: pytest | |
| mujoco-example: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install system dependencies (OSMesa for headless rendering) | |
| run: sudo apt-get update && sudo apt-get install -y libosmesa6-dev | |
| - name: Install package with MuJoCo backend | |
| run: pip install -e ".[mujoco]" Pillow | |
| - name: Run MuJoCo grasp example | |
| env: | |
| MUJOCO_GL: osmesa | |
| run: python examples/mujoco_grasp.py --report --output-dir ./harness_output | |
| - name: Upload visual artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mujoco-grasp-output | |
| path: | | |
| harness_output/report.html | |
| harness_output/mujoco_grasp/trial_001/**/*_rgb.png | |
| harness_output/mujoco_grasp/trial_001/**/metadata.json | |
| retention-days: 30 | |
| - name: Post summary with checkpoint images | |
| run: | | |
| echo "## MuJoCo Grasp Example Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Checkpoint captures from the scripted grasp sequence:" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| for cp in harness_output/mujoco_grasp/trial_001/*/; do | |
| name=$(basename "$cp") | |
| echo "### ${name}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Embed front view as base64 in summary | |
| if [ -f "${cp}front_rgb.png" ]; then | |
| echo ")" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ -f "${cp}metadata.json" ]; then | |
| step=$(python3 -c "import json; print(json.load(open('${cp}metadata.json'))['step'])") | |
| sim_time=$(python3 -c "import json; print(f\"{json.load(open('${cp}metadata.json'))['sim_time']:.3f}\")") | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Step: ${step} | Sim time: ${sim_time}s" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| done | |
| echo "---" >> $GITHUB_STEP_SUMMARY | |
| echo "Download the full artifact (including HTML report) from the Actions tab." >> $GITHUB_STEP_SUMMARY |