Skip to content
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
80374e4
chore(workflow): run CI on both x86_64 and aarch64 Linux
kanarus Sep 15, 2025
45a8025
fix mujoco downloading
kanarus Sep 15, 2025
23eb320
refactor around matrix & specify `C_INCLUDE_PATH`, `CPLUS_INCLUDE_PATH`
kanarus Sep 15, 2025
8df6399
considering cross-building on ubuntu-latest = x86_64
kanarus Sep 15, 2025
5acca91
when aarch64 `export BINDGEN_EXTRA_CLANG_ARGS=-I/usr/aarch64-linux-gn…
kanarus Sep 15, 2025
647c641
when aarch64 install g++-aarch64-linux-gnu
kanarus Sep 15, 2025
cfabf95
prevent if-fail
kanarus Sep 15, 2025
28e350f
try `sudo dpkg --add-architecture arm64`, `:arm64` and `PKG_CONFIG_PA…
kanarus Sep 15, 2025
47eccbc
try `libglfw3` apt package
kanarus Sep 15, 2025
5550cc7
fill missing `:arm64`
kanarus Sep 15, 2025
2bf840e
try source build glfw with conditional dependency libs
kanarus Sep 15, 2025
ab99978
try conditional cmake(\:arm64)?
kanarus Sep 15, 2025
a14e692
use `-DCMAKE_C(XX)?_COMPILER=aarch64-linux-gnu-g(cc|++)`
kanarus Sep 15, 2025
2594fe0
try wayland-protocols
kanarus Sep 15, 2025
518ec88
set -x
kanarus Sep 15, 2025
8256b15
try restricting security repository to amd64
kanarus Sep 15, 2025
cac5bf6
ignore apt update error
kanarus Sep 15, 2025
93ffca5
add ports to /etc/apt/sources.list.d/ports.list
kanarus Sep 15, 2025
3ee3f32
`:arm64` only for `*-dev`
kanarus Sep 15, 2025
db319f0
run `echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $…
kanarus Sep 15, 2025
5e79b82
add `-DCMAKE_EXE_LINKER_FLAGS=-lm` to cmake flags
kanarus Sep 15, 2025
7cdd26a
use `-DLINK_FLAGS="-lm"`
kanarus Sep 15, 2025
0362e3f
`="-lm"` instead of `=-lm` for `-DCMAKE_EXE_LINKER_FLAGS`
kanarus Sep 15, 2025
2758faf
specify ` -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUI…
kanarus Sep 15, 2025
587d840
retain original $PKG_CONFIG_PATH
kanarus Sep 15, 2025
d8e6ce0
improve PKG_CONFIG_PATH
kanarus Sep 15, 2025
81affe0
set PKG_CONFIG=aarch64-linux-gnu-pkg-config
kanarus Sep 15, 2025
b273815
apt install pkg-config when aarch64
kanarus Sep 15, 2025
cf5b2d2
split runner
kanarus Sep 15, 2025
0236efc
use needs's output for job-level if-condition
kanarus Sep 15, 2025
34ce3db
fix around strategy
kanarus Sep 15, 2025
71dbb0e
unify tests
kanarus Sep 15, 2025
8a78b9e
remove unused comments & refine conditional filename
kanarus Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 35 additions & 20 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ jobs:

strategy:
matrix:
toolchain: [stable, nightly]
toolchain: ['stable', 'nightly']
arch: ['x86_64', 'aarch64']

steps:
- uses: actions/checkout@v5

- run: |
rustup update
rustup default ${{ matrix.toolchain }}
rustup component add rustfmt ### required for the build script to work ###
rustup target add ${{ matrix.arch }}-unknown-linux-gnu
rustup component add rustfmt ### required for the build script to work ###
[ "${{ matrix.arch }}" = 'aarch64' ] && sudo apt update && sudo apt install -y g++-aarch64-linux-gnu || :

- name: check fails without MUJOCO_DIR
env:
CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu
run: |
if cargo build; then
echo 'cargo check succeeded without mujoco, which is unexpected.'
Expand All @@ -36,12 +41,14 @@ jobs:
run: |
mkdir -p $HOME/.mujoco
cd $HOME/.mujoco
wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz
tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz
wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz
tar -xzf mujoco-3.3.2-linux-${{ matrix.arch }}.tar.gz
echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: check succeeds with MUJOCO_DIR
env:
CARGO_BUILD_TARGET: ${{ matrix.arch }}-unknown-linux-gnu
run: |
if cargo build; then
echo 'cargo check succeeded with mujoco, as expected.'
Expand All @@ -50,36 +57,44 @@ jobs:
echo "[DEBUG] bindgen.rs content:" && cat ./src/bindgen.rs
exit 1
fi

test:
runs-on: ubuntu-latest

strategy:
matrix:
toolchain: [stable, nightly]

toolchain: ['stable', 'nightly']
os: ['ubuntu-24.04', 'ubuntu-24.04-arm']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: setup
- uses: actions/checkout@v5
- name: setup Rust
run: |
rustup update
rustup default ${{ matrix.toolchain }}
rustup component add rustfmt ### required for the build script to work ###
mkdir -p $HOME/.mujoco
cd $HOME/.mujoco
wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/mujoco-3.3.2-linux-x86_64.tar.gz
tar -xzf mujoco-3.3.2-linux-x86_64.tar.gz
rustup component add rustfmt ### required for the build script to work ###

- name: setup MuJoCo
run: |
if [ "${{ matrix.os }}" = 'ubuntu-24.04' ]; then
MUJOCO_FILENAME='mujoco-3.3.2-linux-x86_64.tar.gz'
elif [ "${{ matrix.os }}" = 'ubuntu-24.04-arm' ]; then
MUJOCO_FILENAME='mujoco-3.3.2-linux-aarch64.tar.gz'
fi
mkdir -p $HOME/.mujoco && cd $HOME/.mujoco
wget https://github.com/google-deepmind/mujoco/releases/download/3.3.2/$MUJOCO_FILENAME
tar -xzf $MUJOCO_FILENAME
echo "MUJOCO_DIR=$HOME/.mujoco/mujoco-3.3.2" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/.mujoco/mujoco-3.3.2/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: setup additional dependencies for examples
run: |
sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev
git clone https://github.com/glfw/glfw.git
mkdir -p glfw/build && cd glfw/build
sudo apt update && sudo apt install -y cmake build-essential libwayland-dev libxkbcommon-x11-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev
cmake .. && make && sudo make install

- name: run tests
run: |
cargo test --lib
Expand Down
Loading