Skip to content

Commit

Permalink
[misc] Cleanup MacOS CI workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
duburcqa committed Nov 18, 2024
1 parent e5c4897 commit dd07927
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
41 changes: 16 additions & 25 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ jobs:
strategy:
matrix:
OS: ['macos-14'] # 'macos-13': Intel (x86), 'macos-14+': Apple Silicon (arm64)
OS: ['macos-15'] # 'macos-13': Intel (x86), 'macos-14+': Apple Silicon (arm64)
PYTHON_VERSION: ['3.10', '3.11', '3.12'] # `setup-python` does not support Python<3.10 on Apple Silicon
BUILD_TYPE: ['Release']
include:
- OS: 'macos-13'
PYTHON_VERSION: '3.11'
PYTHON_VERSION: '3.10'
BUILD_TYPE: 'Release'
- OS: 'macos-15'
PYTHON_VERSION: '3.12'
BUILD_TYPE: 'Debug'
LINKER_FLAGS: '-Wl,-ld_classic' # New "ld_prime" linker (XCode 15+) causes build failures

Expand Down Expand Up @@ -61,6 +64,11 @@ jobs:
echo "RootDir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "InstallDir=${GITHUB_WORKSPACE}/install" >> $GITHUB_ENV
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
echo "JIMINY_PANDA3D_FORCE_TINYDISPLAY=" >> $GITHUB_ENV
fi
"${PYTHON_EXECUTABLE}" -m pip install setuptools wheel "pip>=20.3"
"${PYTHON_EXECUTABLE}" -m pip install delocate twine
- name: Install pre-compiled binaries for additional gym-jiminy dependencies
Expand Down Expand Up @@ -127,15 +135,12 @@ jobs:
# (see https://github.com/python/mypy/issues/17396)
"${PYTHON_EXECUTABLE}" -m pip install "numpy<2.0"
stubgen -p jiminy_py -o ${RootDir}/build/pypi/jiminy_py/src
# FIXME: Python 3.10 crashes when generating stubs without any backtrace...
if [[ "${{ matrix.PYTHON_VERSION }}" != '3.10' ]] ; then
# lldb --batch -o "settings set target.process.stop-on-exec false" \
# -o "break set -n main" -o "run" -k "bt" -k "quit" -- \
"${PYTHON_EXECUTABLE}" "${RootDir}/build_tools/stubgen.py" \
-o ${RootDir}/build/stubs --ignore-invalid=all jiminy_py
cp ${RootDir}/build/stubs/jiminy_py-stubs/core/__init__.pyi \
${RootDir}/build/pypi/jiminy_py/src/jiminy_py/core/core.pyi
fi
# lldb --batch -o "settings set target.process.stop-on-exec false" \
# -o "break set -n main" -o "run" -k "bt" -k "quit" -- \
"${PYTHON_EXECUTABLE}" "${RootDir}/build_tools/stubgen.py" \
-o ${RootDir}/build/stubs --ignore-invalid=all jiminy_py
cp ${RootDir}/build/stubs/jiminy_py-stubs/core/__init__.pyi \
${RootDir}/build/pypi/jiminy_py/src/jiminy_py/core/core.pyi
# Generate wheels
cd "${RootDir}/build"
Expand Down Expand Up @@ -184,22 +189,12 @@ jobs:
ctest --output-on-failure --test-dir "${RootDir}/build/core/unit"
cd "${RootDir}/python/jiminy_py/unit_py"
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
export JIMINY_PANDA3D_FORCE_TINYDISPLAY=
fi
"${PYTHON_EXECUTABLE}" -m unittest discover -v
- name: Run unit tests for gym jiminy base module
run: |
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
export JIMINY_PANDA3D_FORCE_TINYDISPLAY=
fi
# FIXME: Disabling `test_pipeline_control.py` on MacOS because `test_pid_standing` is
# failing for 'panda3d-sync' backend due to meshes still loading at screenshot time.
if [[ "${{ matrix.BUILD_TYPE }}" == 'Debug' ]] ; then
export JIMINY_BUILD_DEBUG=
fi
Expand All @@ -211,10 +206,6 @@ jobs:
export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib"
cd "${RootDir}/python/gym_jiminy/examples/rllib"
# FIXME: Panda3d software rendering is partially broken on Apple Silicon
if [[ "${{ matrix.OS }}" != 'macos-13' ]] ; then
export JIMINY_PANDA3D_FORCE_TINYDISPLAY=
fi
"${PYTHON_EXECUTABLE}" acrobot_ppo.py
#########################################################################################
Expand Down
2 changes: 0 additions & 2 deletions python/gym_jiminy/unit_py/test_pipeline_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ def _test_pid_standing(self):
self.assertTrue(np.all(
np.abs(velocity_mes[time > time[-1] - 1.0]) < 1.0e-3))

@unittest.skipIf(DEBUG and sys.platform == "darwin",
"skipping when compiled in debug on Mac OS")
def test_pid_standing(self):
for backend in ('panda3d-sync', 'meshcat'):
for Env in (AtlasPDControlJiminyEnv,
Expand Down
2 changes: 1 addition & 1 deletion python/jiminy_pywrap/src/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace jiminy::python

BOOST_PYTHON_MODULE(PYTHON_LIBRARY_NAME)
{
/* Initialized Numpy C API.
/* Initialized "local" Numpy C API.
This is required to handle raw `numpy::ndarray` objects manually. */
import_numpy();

Expand Down

0 comments on commit dd07927

Please sign in to comment.