Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco CI Build Steps

From Leeroopedia
Knowledge Sources
Domains CI/CD, Build Automation, Shell Scripting
Last Updated 2026-02-15 04:00 GMT

Overview

Bash helper script that encapsulates the discrete build steps (prepare, configure, build, test, install) invoked by the GitHub Actions CI workflow.

Description

The build_steps.sh script provides a collection of shell functions that the CI workflow calls to prepare the build environment, configure CMake, compile MuJoCo, and run tests. It handles platform-specific setup such as installing Linux system dependencies (Mesa, Wayland, X11 libraries, Ninja), creating a Python virtual environment with pinned dependencies, setting up the Emscripten SDK for WASM builds, and configuring CMake with release-mode settings. Each function is designed to be called independently from the workflow, enabling modular and reorderable CI steps.

Usage

This script is sourced or invoked by the .github/workflows/build.yml workflow. Individual functions like prepare_linux, prepare_python, configure_mujoco, setup_emsdk, and npm_ci are called as discrete steps within the CI job.

Code Reference

Source Location

Key Functions

// Linux system dependency installation
prepare_linux() {
    sudo apt-get update && sudo apt-get install \
        libgl1-mesa-dev \
        libwayland-dev \
        libxinerama-dev \
        libxcursor-dev \
        libxkbcommon-dev \
        libxrandr-dev \
        libxi-dev \
        ninja-build
}

// Python virtual environment setup
prepare_python() {
    python -m venv venv
    source venv/bin/activate
    python -m pip install --upgrade --require-hashes \
        -r "${repo}/python/build_requirements.txt"
    python -m pip install --upgrade --require-hashes \
        -r "${repo}/python/build_requirements_usd.txt"
}

// CMake configuration
configure_mujoco() {
    mkdir build && cd build &&
    cmake .. \
        -DCMAKE_BUILD_TYPE:STRING=Release \
        -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF \
        -DCMAKE_INSTALL_PREFIX:STRING=${TMPDIR}/mujoco_install \
        -DMUJOCO_BUILD_EXAMPLES:BOOL=OFF \
        ${CMAKE_ARGS}
}

// Emscripten SDK setup for WASM builds
setup_emsdk() {
    git clone https://github.com/emscripten-core/emsdk.git
    ./emsdk/emsdk install 4.0.10
    ./emsdk/emsdk activate 4.0.10
}

I/O Contract

Inputs

Name Type Required Description
CMAKE_ARGS Environment variable Yes Additional CMake arguments passed from the workflow matrix (compiler, generator, flags)
TMPDIR Environment variable Yes Temporary directory path for virtual environments and install prefixes
RUNNER_OS Environment variable No GitHub Actions runner OS identifier, used for Windows-specific path fixups
PWD Environment variable Yes Current working directory, expected to be the repository root

Outputs

Name Type Description
build/ directory Directory CMake build directory containing compiled artifacts
${TMPDIR}/mujoco_install Directory CMake install prefix where built libraries and headers are placed
${TMPDIR}/venv Directory Python virtual environment with pinned build dependencies
Emscripten SDK Directory Cloned and activated emsdk for WASM cross-compilation

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment