-
Notifications
You must be signed in to change notification settings - Fork 1.4k
455 lines (404 loc) · 15.8 KB
/
build.yml
File metadata and controls
455 lines (404 loc) · 15.8 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
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# This configuration is used to build and test on GitHub Actions only.
# It is not the same configuration that is used by Google DeepMind to create release binaries.
# The "official" binaries are built with Clang 13 on all platforms, and are linked against libc++
# on Linux.
#
# We set CMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF here to reduce build time.
# It is highly recommended that this is set to ON for production builds.
# TODO(matijak): Consider switching Windows to Ninja builds only, this configures slightly faster
# and brings Windows in line with other OSes. Also we wouldn't need to specify the --config option
# in the build step because Ninja doesn't support multiple configurations (unlike MSBuild).
name: build
on:
push:
paths-ignore:
- "doc/**"
- "**/README.md"
pull_request:
paths-ignore:
- "doc/**"
- "**/README.md"
jobs:
mujoco:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
label: "ubuntu-24.04-gcc-14"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-14
-DCMAKE_CXX_COMPILER:STRING=g++-14
-DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--no-as-needed
tmpdir: "/tmp"
- os: ubuntu-24.04
label: "ubuntu-24.04-gcc-13"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-13
-DCMAKE_CXX_COMPILER:STRING=g++-13
-DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--no-as-needed
tmpdir: "/tmp"
- os: ubuntu-22.04
label: "ubuntu-22.04-gcc-12"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-12
-DCMAKE_CXX_COMPILER:STRING=g++-12
-DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--no-as-needed
tmpdir: "/tmp"
- os: ubuntu-22.04
label: "ubuntu-22.04-gcc-11"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-11
-DCMAKE_CXX_COMPILER:STRING=g++-11
-DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--no-as-needed
tmpdir: "/tmp"
- os: ubuntu-22.04
label: "ubuntu-22.04-gcc-10"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=gcc-10
-DCMAKE_CXX_COMPILER:STRING=g++-10
-DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--no-as-needed
tmpdir: "/tmp"
- os: ubuntu-24.04
label: "ubuntu-24.04-clang-18"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-18
-DCMAKE_CXX_COMPILER:STRING=clang++-18
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-24.04
label: "ubuntu-24.04-clang-17"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-17
-DCMAKE_CXX_COMPILER:STRING=clang++-17
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-24.04
label: "ubuntu-24.04-clang-16"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-16
-DCMAKE_CXX_COMPILER:STRING=clang++-16
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-22.04
label: "ubuntu-22.04-clang-15"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-15
-DCMAKE_CXX_COMPILER:STRING=clang++-15
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-22.04
label: "ubuntu-22.04-clang-14"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-14
-DCMAKE_CXX_COMPILER:STRING=clang++-14
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: ubuntu-22.04
label: "ubuntu-22.04-clang-13"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-13
-DCMAKE_CXX_COMPILER:STRING=clang++-13
-DCMAKE_EXE_LINKER_FLAGS:STRING=-rtlib=compiler-rt
-DCMAKE_SHARED_LINKER_FLAGS:STRING=-rtlib=compiler-rt
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: macos-15
label: "macos-15-arm64"
cmake_args: >-
-G Ninja
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: macos-15-large
label: "macos-15-x86_64"
cmake_args: >-
-G Ninja
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: windows-2025
label: "windows-2025"
cmake_args: >-
-DCMAKE_SYSTEM_VERSION="10.0.26100.0"
cmake_build_args: "-- -m"
tmpdir: "C:/Temp"
name: "${{ matrix.label }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Prepare Linux
if: ${{ runner.os == 'Linux' }}
run: bash ./.github/workflows/build_steps.sh prepare_linux
- name: Prepare macOS
if: ${{ runner.os == 'macOS' }}
run: brew install ninja
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Prepare Python
shell: bash
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ./.github/workflows/build_steps.sh prepare_python
- name: Setup Node.js for WASM bindings
if: ${{ runner.os == 'Linux' && matrix.label != 'ubuntu-24.04-clang-18' }}
uses: actions/setup-node@v4
with:
node-version: '20'
# Exclude platforms covered by the `wasm` job.
- name: Install NPM Dependencies for WASM bindings
if: ${{ runner.os == 'Linux' && matrix.label != 'ubuntu-24.04-clang-18' }}
run: bash ./.github/workflows/build_steps.sh npm_ci
# Exclude platforms covered by the `wasm` job.
- name: Setup Emscripten for WASM bindings
if: ${{ runner.os == 'Linux' && matrix.label != 'ubuntu-24.04-clang-18' }}
run: bash ./.github/workflows/build_steps.sh setup_emsdk
- name: Configure MuJoCo
env:
TMPDIR: ${{ matrix.tmpdir }}
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ./.github/workflows/build_steps.sh configure_mujoco
- name: Build MuJoCo
working-directory: build
env:
CMAKE_BUILD_ARGS: ${{ matrix.cmake_build_args }}
run: bash ../.github/workflows/build_steps.sh build_mujoco
- name: Copy in the correct VC runtime DLLs (workaround for actions/runner-images#10004)
if: ${{ runner.os == 'Windows' }}
working-directory: build
shell: powershell
run: |
Copy-Item (Join-Path `
((Get-ChildItem -Directory `
-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.*" |
Sort -Descending | Select-Object -First 1).FullName
) 'x64\Microsoft.VC143.CRT\*.dll') "bin\Release"
- name: Test MuJoCo
working-directory: build
run: bash ../.github/workflows/build_steps.sh test_mujoco
- name: Install MuJoCo
working-directory: build
run: bash ../.github/workflows/build_steps.sh install_mujoco
- name: Copy plugins (POSIX)
if: ${{ runner.os != 'Windows' }}
working-directory: build
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../.github/workflows/build_steps.sh copy_plugins_posix
- name: Copy plugins (Windows)
if: ${{ runner.os == 'Windows' }}
working-directory: build
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../.github/workflows/build_steps.sh copy_plugins_window
- name: Configure samples
working-directory: sample
env:
TMPDIR: ${{ matrix.tmpdir }}
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ../.github/workflows/build_steps.sh configure_samples
- name: Build samples
working-directory: sample/build
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
- name: Configure simulate
working-directory: simulate
env:
TMPDIR: ${{ matrix.tmpdir }}
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ../.github/workflows/build_steps.sh configure_simulate
- name: Build simulate
working-directory: simulate/build
env:
CMAKE_BUILD_ARGS: ${{ matrix.cmake_build_args }}
run: bash ../../.github/workflows/build_steps.sh build_simulate
# Exclude platforms covered by the `studio` job.
# Exclude macos-15-x86_64 because we don't have a way maintain/develop the build locally.
- name: Configure Studio
if: ${{ matrix.label != 'windows-2025' &&
matrix.label != 'macos-15-arm64' &&
matrix.label != 'macos-15-x86_64' }}
env:
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ./.github/workflows/build_steps.sh configure_studio
# Exclude platforms covered by the `studio` job.
# Exclude macos-15-x86_64 because we don't have a way maintain/develop the build locally.
# TODO(haroonq): Fix Filament compilation for GCC<=12?
- name: Build Studio
if: ${{ matrix.label != 'windows-2025' &&
matrix.label != 'macos-15-arm64' &&
matrix.label != 'macos-15-x86_64' &&
matrix.label != 'ubuntu-22.04-gcc-10' &&
matrix.label != 'ubuntu-22.04-gcc-11' &&
matrix.label != 'ubuntu-22.04-gcc-12' }}
run: bash ./.github/workflows/build_steps.sh build_studio
- name: Make Python sdist
shell: bash
working-directory: python
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../.github/workflows/build_steps.sh make_python_sdist
- name: Build Python bindings
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: python/dist
env:
TMPDIR: ${{ matrix.tmpdir }}
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ../../.github/workflows/build_steps.sh build_python_bindings
- name: Install Python bindings
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: python/dist
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../../.github/workflows/build_steps.sh install_python_bindings
- name: Test Python bindings
if: ${{ runner.os != 'Windows' }}
shell: bash
env:
MUJOCO_GL: disable
TMPDIR: ${{ matrix.tmpdir }}
run: bash ./.github/workflows/build_steps.sh test_python_bindings
# Exclude platforms covered by the `wasm` job.
- name: Build and Test WASM bindings
if: ${{ runner.os == 'Linux' && matrix.label != 'ubuntu-24.04-clang-18' }}
shell: bash
run: bash ./.github/workflows/build_steps.sh build_test_wasm
- name: Package MJX
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: mjx
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../.github/workflows/build_steps.sh package_mjx
- name: Install MJX
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: mjx
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../.github/workflows/build_steps.sh install_mjx
- name: Test MJX
if: ${{ runner.os != 'Windows' }}
shell: bash
working-directory: mjx
env:
TMPDIR: ${{ matrix.tmpdir }}
run: bash ../.github/workflows/build_steps.sh test_mjx
- name: Notify team chat
shell: bash
env:
GCHAT_API_URL: ${{ secrets.GCHAT_API }}
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CHATMSG_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
CHATMSG_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
CHATMSG_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
CHATMSG_JOB_ID: ${{ matrix.label }}
if: ${{ failure() && github.event_name == 'push' && env.GCHAT_API_URL != '' }}
run: bash ./.github/workflows/build_steps.sh notify_team_chat
# This job quickly determines if MuJoCo Studio is broken.
studio:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
label: "ubuntu-24.04-clang-18-studio"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-18
-DCMAKE_CXX_COMPILER:STRING=clang++-18
-DMUJOCO_HARDEN:BOOL=ON
- os: windows-2025
label: "windows-2025-ninja-studio"
cmake_args: >-
-G Ninja
-DCMAKE_SYSTEM_VERSION=10.0.26100.0
- os: macos-15
label: "macos-15-arm64-studio"
cmake_args: >-
-G Ninja
-DCMAKE_CXX_FLAGS="-Wno-error=deprecated-declarations"
-DMUJOCO_HARDEN:BOOL=ON
name: "${{ matrix.label }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Prepare Windows (setup MSVC)
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Prepare Linux
if: ${{ runner.os == 'Linux' }}
run: bash ./.github/workflows/build_steps.sh prepare_linux
- name: Configure Studio with legacy OpenGL rendering
env:
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ./.github/workflows/build_steps.sh configure_studio_legacy_opengl
- name: Build Studio with legacy OpenGL rendering
run: bash ./.github/workflows/build_steps.sh build_studio
- name: Configure Studio with Filament rendering
env:
CMAKE_ARGS: ${{ matrix.cmake_args }}
run: bash ./.github/workflows/build_steps.sh configure_studio
- name: Build Studio with Filament rendering
run: bash ./.github/workflows/build_steps.sh build_studio
- name: Notify team chat
shell: bash
env:
GCHAT_API_URL: ${{ secrets.GCHAT_API }}
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CHATMSG_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
CHATMSG_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
CHATMSG_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
CHATMSG_JOB_ID: ${{ matrix.label }}
if: ${{ failure() && github.event_name == 'push' && env.GCHAT_API_URL != '' }}
run: bash ./.github/workflows/build_steps.sh notify_team_chat
# This job quickly determines if WASM bindings are broken.
wasm:
name: "ubuntu-24.04-clang-18-wasm"
runs-on: ubuntu-24.04
env:
label: "ubuntu-24.04-clang-18-wasm"
cmake_args: >-
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-18
-DCMAKE_CXX_COMPILER:STRING=clang++-18
-DMUJOCO_HARDEN:BOOL=ON
steps:
- uses: actions/checkout@v3
- name: Setup Node.js for WASM bindings
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Prepare Linux
if: ${{ runner.os == 'Linux' }}
run: bash ./.github/workflows/build_steps.sh prepare_linux
# For convenience run multiple build_steps functions in a single step.
- name: Prepare, Build and Test WASM bindings
env:
CMAKE_ARGS: ${{ env.cmake_args }}
run: |
bash ./.github/workflows/build_steps.sh npm_ci
bash ./.github/workflows/build_steps.sh setup_emsdk
bash ./.github/workflows/build_steps.sh build_test_wasm
- name: Notify team chat
shell: bash
env:
GCHAT_API_URL: ${{ secrets.GCHAT_API }}
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CHATMSG_AUTHOR_NAME: ${{ github.event.head_commit.author.name }}
CHATMSG_AUTHOR_EMAIL: ${{ github.event.head_commit.author.email }}
CHATMSG_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
CHATMSG_JOB_ID: ${{ env.label }}
if: ${{ failure() && github.event_name == 'push' && env.GCHAT_API_URL != '' }}
run: bash ./.github/workflows/build_steps.sh notify_team_chat