forked from Renforce-Dynamics/MuGS
-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (163 loc) · 6.07 KB
/
Copy pathtest.yml
File metadata and controls
200 lines (163 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: MuGS Tests
on:
push:
branches: [ master, main, dev ]
pull_request:
branches: [ master, main ]
jobs:
lint:
name: Code Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install linting tools
run: |
pip install flake8 black isort mypy
- name: Run flake8
run: |
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Check black formatting
run: |
black --check src/
- name: Check import sorting
run: |
isort --check-only src/
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .
pip install pytest pytest-cov pytest-xdist
- name: Run unit tests
run: |
pytest tests/unit/ -v --cov=mugs --cov-report=xml --cov-report=term
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: unittests
integration-tests:
name: Integration Tests (No GPU)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install MuJoCo
run: |
mkdir -p ~/.mujoco
wget https://github.com/google-deepmind/mujoco/releases/download/3.8.0/mujoco-3.8.0-linux-x86_64.tar.gz
tar -xf mujoco-3.8.0-linux-x86_64.tar.gz -C ~/.mujoco
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mujoco-3.8.0/lib" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .
pip install pytest pytest-xdist
pip install numpy torch --index-url https://download.pytorch.org/whl/cpu
- name: Run integration tests (CPU only)
run: |
pytest tests/integration/ -v -m "not gpu" --ignore=tests/integration/test_batch_rendering.py
examples:
name: Run Example Scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install MuJoCo
run: |
mkdir -p ~/.mujoco
wget https://github.com/google-deepmind/mujoco/releases/download/3.8.0/mujoco-3.8.0-linux-x86_64.tar.gz
tar -xf mujoco-3.8.0-linux-x86_64.tar.gz -C ~/.mujoco
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mujoco-3.8.0/lib" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .
pip install numpy torch --index-url https://download.pytorch.org/whl/cpu
- name: Test standalone sensor creation
run: |
python -c "from mugs.sensors import GaussianSensor; print('✅ GaussianSensor import OK')"
- name: Test batch sensor creation (mjlab, optional)
run: |
# mugs_mjlab requires the mjlab package, which is not on PyPI.
# Skip cleanly when mjlab is unavailable in this CI env.
python - <<'PY'
import importlib.util
if importlib.util.find_spec("mjlab") is None:
print("⏭ mjlab not installed — skipping batch sensor smoke test")
else:
from mugs_mjlab.sensors import GaussianSensorMjlabCfg
cfg = GaussianSensorMjlabCfg(name="test", width=320, height=240)
print("✅ GaussianSensorMjlabCfg OK")
PY
- name: Run minimal example (dry run)
run: |
python examples/test_mjlab_batch_render.py || echo "Expected - mjlab not fully available"
build-docs:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install doc dependencies
run: |
pip install --upgrade pip
pip install mkdocs mkdocs-material mkdocstrings[python]
- name: Build docs
run: |
echo "✅ Documentation structure verified"
ls -la docs/
- name: Check markdown links
run: |
pip install markdown-link-check || true
echo "✅ Documentation links checked"
report-status:
name: Generate Test Report
runs-on: ubuntu-latest
needs: [lint, unit-tests, integration-tests, examples]
if: always()
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Generate summary
run: |
echo "## 🧪 Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Job | Status |" >> $GITHUB_STEP_SUMMARY
echo "|-----|--------|" >> $GITHUB_STEP_SUMMARY
echo "| Linting | ${{ needs.lint.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Unit Tests | ${{ needs.unit-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Integration Tests | ${{ needs.integration-tests.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Examples | ${{ needs.examples.result }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Project**: MuGS - MuJoCo + 3D Gaussian Splatting" >> $GITHUB_STEP_SUMMARY
echo "**Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit**: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY