-
Notifications
You must be signed in to change notification settings - Fork 141
438 lines (434 loc) · 18.1 KB
/
Copy pathtest.yml
File metadata and controls
438 lines (434 loc) · 18.1 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
name: Bazel Build and Test
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: write
contents: read
jobs:
test-linux-x64:
name: Test (linux-x64)
runs-on: ubuntu-24.04
timeout-minutes: 300
env:
CACHE_BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
# Keep hosted Linux runners responsive during the full MuJoCo/MyoSuite coverage
# build. The default HOST_CPUS-1 parallelism can starve the runner hard
# enough for GitHub Actions to lose communication.
BAZEL_CI_RESOURCE_OPTS: --jobs=2 --local_resources=cpu=2 --local_resources=memory=HOST_RAM*.35 --experimental_disk_cache_gc_max_size=2G --experimental_disk_cache_gc_idle_delay=0s
MUJOCO_GL: egl
EGL_PLATFORM: surfaceless
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version: "1.27"
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "25"
- name: Set up Python 3.12
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake lcov ninja-build swig qt6-base-dev libegl1-mesa-dev libopengl-dev
python -m pip install --upgrade cmake
- name: Restore Bazel caches
uses: actions/cache/restore@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}
restore-keys: |
bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.DEFAULT_BRANCH }}-
bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-
- name: Install bazelisk
run: |
go install github.com/bazelbuild/bazelisk@latest
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Coverage
run: |
make BAZELOPT="--repository_cache=$HOME/.cache/envpool-bazel-repo --disk_cache=$HOME/.cache/envpool-bazel-disk $BAZEL_CI_RESOURCE_OPTS" \
BAZEL_TEST_TARGETS="//..." bazel-coverage
mkdir -p coverage
cp bazel-out/_coverage/_coverage_report.dat coverage/lcov.info
python3 scripts/coverage_summary.py \
--lcov coverage/lcov.info \
--output-dir coverage \
--summary-file coverage/summary.md \
--badge-file coverage/coverage-badge.svg \
--genhtml-lcov-file coverage/lcov.genhtml.info \
--repo-root "$GITHUB_WORKSPACE"
- name: Shut down Bazel
if: ${{ always() && !cancelled() }}
continue-on-error: true
run: bazelisk shutdown
- name: Publish coverage summary
run: cat coverage/summary.md >> "$GITHUB_STEP_SUMMARY"
- name: Build coverage site
run: |
genhtml coverage/lcov.genhtml.info \
--prefix "$GITHUB_WORKSPACE" \
--branch-coverage \
--ignore-errors negative,category \
--legend \
--output-directory coverage/site \
--title "EnvPool coverage report"
cp coverage/coverage-badge.svg coverage/site/coverage-badge.svg
- name: Upload coverage artifacts
if: ${{ always() && !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: coverage-report-linux-x64-${{ github.sha }}
path: coverage
if-no-files-found: warn
- name: Upload coverage Pages artifact
if: ${{ github.event_name == 'push' }}
uses: actions/upload-pages-artifact@v5
with:
path: coverage/site
- name: Save Bazel caches
id: save-bazel-caches
if: ${{ always() && !cancelled() }}
uses: actions/cache/save@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}-${{ github.run_id }}-attempt${{ github.run_attempt }}
- name: Prune older Bazel caches
if: ${{ success() && (steps.save-bazel-caches.outcome == 'success' || steps.save-bazel-caches.outcome == 'skipped') }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: >-
python scripts/prune_actions_caches.py
--repo "${{ github.repository }}"
--prefix "bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-"
--group-by-branch
--delete-missing-branches
--keep 1
test-linux-arm64:
name: Test (linux-arm64)
runs-on: ubuntu-24.04-arm
timeout-minutes: 300
env:
CACHE_BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
# Keep hosted Linux runners responsive during the full MuJoCo/MyoSuite test
# build. The default HOST_CPUS-1 parallelism can starve the runner hard
# enough for GitHub Actions to lose communication.
# Match the official arm64 MuJoCo wheel's Clang 20 toolchain so contact-
# heavy oracle rollouts do not diverge from GCC-generated physics code.
BAZEL_CI_RESOURCE_OPTS: >-
--repo_env=CC=/usr/bin/clang-20
--repo_env=CXX=/usr/bin/clang++-20
--compiler=clang
--jobs=2 --local_resources=cpu=2 --local_resources=memory=HOST_RAM*.35
--experimental_disk_cache_gc_max_size=2G --experimental_disk_cache_gc_idle_delay=0s
MUJOCO_GL: egl
EGL_PLATFORM: surfaceless
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version: "1.27"
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "25"
- name: Set up Python 3.12
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang-20 cmake lcov ninja-build swig qt6-base-dev libegl1-mesa-dev libopengl-dev
python -m pip install --upgrade cmake
- name: Restore Bazel caches
uses: actions/cache/restore@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}
restore-keys: |
bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.DEFAULT_BRANCH }}-
bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-
- name: Install bazelisk
run: |
go install github.com/bazelbuild/bazelisk@latest
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Test
run: |
make BAZELOPT="--repository_cache=$HOME/.cache/envpool-bazel-repo --disk_cache=$HOME/.cache/envpool-bazel-disk $BAZEL_CI_RESOURCE_OPTS" \
BAZEL_TEST_TARGETS="//..." bazel-test
- name: Shut down Bazel
if: ${{ always() && !cancelled() }}
continue-on-error: true
run: bazelisk shutdown
- name: Save Bazel caches
id: save-bazel-caches
if: ${{ always() && !cancelled() }}
uses: actions/cache/save@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}-${{ github.run_id }}-attempt${{ github.run_attempt }}
- name: Prune older Bazel caches
if: ${{ success() && (steps.save-bazel-caches.outcome == 'success' || steps.save-bazel-caches.outcome == 'skipped') }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: >-
python scripts/prune_actions_caches.py
--repo "${{ github.repository }}"
--prefix "bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-"
--group-by-branch
--delete-missing-branches
--keep 1
test-macos:
name: Test (macos)
runs-on: macos-14
timeout-minutes: 180
env:
CACHE_BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
BAZEL_CI_RESOURCE_OPTS: --jobs=HOST_CPUS-1 --local_resources=cpu=HOST_CPUS-1 --local_resources=memory=HOST_RAM*.5
HOMEBREW_NO_AUTO_UPDATE: "1"
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version: "1.27"
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "25"
- name: Set up Python 3.12
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install macOS dependencies
run: |
brew install ninja swig qtbase
python -m pip install --upgrade cmake
CMAKE_BIN_DIR="$(python -c "import cmake; print(cmake.CMAKE_BIN_DIR)")"
CMAKE_BIN="$CMAKE_BIN_DIR/cmake"
echo "$CMAKE_BIN_DIR" >> "$GITHUB_PATH"
sudo ln -sfn "$CMAKE_BIN" /usr/local/bin/cmake
PATH="$CMAKE_BIN_DIR:$PATH" cmake --version
sudo ln -sfn "$(brew --prefix ninja)/bin/ninja" /usr/local/bin/ninja
echo "BAZEL_RULES_QT_DIR=$(brew --prefix qtbase)" >> "$GITHUB_ENV"
- name: Restore Bazel caches
uses: actions/cache/restore@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}
restore-keys: |
bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.DEFAULT_BRANCH }}-
bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-
- name: Install bazelisk
run: |
go install github.com/bazelbuild/bazelisk@latest
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Test
run: |
make BAZELOPT="--repository_cache=$HOME/.cache/envpool-bazel-repo --disk_cache=$HOME/.cache/envpool-bazel-disk $BAZEL_CI_RESOURCE_OPTS" bazel-test
- name: Shut down Bazel
if: ${{ always() && !cancelled() }}
continue-on-error: true
run: bazelisk shutdown
- name: Save Bazel caches
id: save-bazel-caches
if: ${{ always() && !cancelled() }}
uses: actions/cache/save@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}-${{ github.run_id }}-attempt${{ github.run_attempt }}
- name: Prune older Bazel caches
if: ${{ success() && (steps.save-bazel-caches.outcome == 'success' || steps.save-bazel-caches.outcome == 'skipped') }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: >-
python scripts/prune_actions_caches.py
--repo "${{ github.repository }}"
--prefix "bazel-test-v3-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-"
--group-by-branch
--delete-missing-branches
--keep 1
test-windows:
name: Test (windows)
runs-on: windows-2022
timeout-minutes: 300
env:
BAZEL_SH: C:/Program Files/Git/usr/bin/bash.exe
CACHE_BRANCH: ${{ github.head_ref || github.ref_name }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
# MSVC ignores the POSIX -g0/-O3 flags from --config=test. Use opt mode
# and a larger capped disk cache so Windows reruns are not cold builds.
BAZEL_CI_RESOURCE_OPTS: --compilation_mode=opt --jobs=HOST_CPUS-1 --local_resources=cpu=HOST_CPUS-1 --local_resources=memory=HOST_RAM*.5 --experimental_disk_cache_gc_max_size=4G --experimental_disk_cache_gc_idle_delay=0s
BAZEL_CACHE_PREFIX: bazel-test-v6-windows-opt-cache4g
MESA_GL_VERSION_OVERRIDE: 4.5COMPAT
MSYS2_ARG_CONV_EXCL: "*"
MSYS_NO_PATHCONV: "1"
USE_BAZEL_VERSION: "9.2.0"
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version: "1.27"
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "25"
- name: Shorten temp path
shell: pwsh
run: |
New-Item -ItemType Directory -Path C:\tmp -Force | Out-Null
Add-Content -Path $env:GITHUB_ENV -Value "TMP=C:\tmp"
Add-Content -Path $env:GITHUB_ENV -Value "TEMP=C:\tmp"
Add-Content -Path $env:GITHUB_ENV -Value "TMPDIR=C:\tmp"
- name: Install Windows dependencies
shell: pwsh
run: |
choco install -y cmake make ninja strawberryperl swig
- name: Create Mesa directory
shell: pwsh
run: |
New-Item -ItemType Directory -Path (Join-Path $env:GITHUB_WORKSPACE ".mesa") -Force | Out-Null
- name: Install Mesa software OpenGL
uses: f3d-app/install-mesa-windows-action@v3
with:
path: ${{ github.workspace }}\.mesa
- name: Export Mesa location
shell: pwsh
run: |
Add-Content -Path $env:GITHUB_ENV -Value "ENVPOOL_DLL_DIR=$env:GITHUB_WORKSPACE\.mesa"
Add-Content -Path $env:GITHUB_PATH -Value "$env:GITHUB_WORKSPACE\.mesa"
- name: Install Qt 6
uses: jurplel/install-qt-action@v4
with:
version: "6.11.1"
# Qt 6.11 repository layout support; not yet in an aqt release.
aqtsource: git+https://github.com/miurahr/aqtinstall.git@8c3695d4a4e1ceabf6a74dc6c79681656dc6b74b
py7zrversion: "==1.1.0"
arch: "win64_msvc2022_64"
set-env: "true"
- name: Export Qt location
shell: pwsh
run: |
Add-Content -Path $env:GITHUB_ENV -Value "BAZEL_RULES_QT_DIR=$env:QT_ROOT_DIR"
Add-Content -Path $env:GITHUB_PATH -Value (Join-Path $env:QT_ROOT_DIR "bin")
Add-Content -Path $env:GITHUB_PATH -Value "C:\Program Files\Git\usr\bin"
- name: Restore Bazel caches
uses: actions/cache/restore@v6
with:
# Keep the Windows disk cache capped. The old uncapped archive grew
# past 7 GB and exhausted the hosted runner disk during extraction.
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: ${{ env.BAZEL_CACHE_PREFIX }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}
restore-keys: |
${{ env.BAZEL_CACHE_PREFIX }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.DEFAULT_BRANCH }}-
${{ env.BAZEL_CACHE_PREFIX }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-
- name: Install bazelisk
shell: pwsh
run: |
go install github.com/bazelbuild/bazelisk@latest
Add-Content -Path $env:GITHUB_PATH -Value (Join-Path $HOME "go/bin")
- name: Set up Python 3.12
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install latest CMake
shell: pwsh
run: |
python -m pip install --upgrade cmake
$cmakeBinDir = python -c "import cmake; print(cmake.CMAKE_BIN_DIR)"
Add-Content -Path $env:GITHUB_PATH -Value $cmakeBinDir
& (Join-Path $cmakeBinDir "cmake.exe") --version
- name: Test
shell: bash
run: |
repo_cache=$(cygpath -am "$HOME/.cache/envpool-bazel-repo")
disk_cache=$(cygpath -am "$HOME/.cache/envpool-bazel-disk")
make BAZELOPT="--repository_cache=$repo_cache --disk_cache=$disk_cache $BAZEL_CI_RESOURCE_OPTS" bazel-test
- name: Shut down Bazel
if: ${{ always() && !cancelled() }}
continue-on-error: true
shell: bash
run: bazelisk shutdown
- name: Save Bazel caches
id: save-bazel-caches
if: ${{ always() && !cancelled() }}
uses: actions/cache/save@v6
with:
path: |
~/.cache/bazelisk
~/.cache/envpool-bazel-repo
~/.cache/envpool-bazel-disk
key: ${{ env.BAZEL_CACHE_PREFIX }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-${{ env.CACHE_BRANCH }}-${{ github.run_id }}-attempt${{ github.run_attempt }}
- name: Prune older Bazel caches
if: ${{ success() && (steps.save-bazel-caches.outcome == 'success' || steps.save-bazel-caches.outcome == 'skipped') }}
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: >-
python scripts/prune_actions_caches.py
--repo "${{ github.repository }}"
--prefix "${{ env.BAZEL_CACHE_PREFIX }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.bazelversion') }}-"
--group-by-branch
--delete-missing-branches
--keep 1
deploy-coverage-pages:
name: Deploy coverage page
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-24.04
needs:
- test-linux-x64
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@v5