From f8f390ee5eeabe3239bcf05b154e5e9c4f041937 Mon Sep 17 00:00:00 2001 From: Alexis Duburcq Date: Wed, 13 Mar 2024 09:59:02 +0100 Subject: [PATCH] [misc] Run all unit tests for gym jiminy base modules on Python 3.12 and Debug. --- .github/workflows/linux.yml | 12 +++++++----- .github/workflows/macos.yml | 18 +++++++----------- .github/workflows/ubuntu.yml | 11 +++++------ .github/workflows/win.yml | 13 +++++-------- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8f6bccb922..6ab6c06624 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -120,17 +120,19 @@ jobs: "${PYTHON_EXECUTABLE}" -m unittest discover -s "$RootDir/python/jiminy_py/unit_py" -v - - name: Run unit tests for gym_jiminy - if: matrix.BUILD_TYPE == 'Release' && matrix.PYTHON_VERSION != '3.12' + - name: Run unit tests for gym jiminy base module + run: | + "${PYTHON_EXECUTABLE}" -m unittest discover -s "$RootDir/python/gym_jiminy/unit_py" -v + + - name: Run examples for gym jiminy add-on modules + if: matrix.BUILD_TYPE != 'Debug' && matrix.PYTHON_VERSION != '3.12' run: | cd "$RootDir/python/gym_jiminy/examples/rllib" gdb -batch -ex "run" -ex "bt" --args "${PYTHON_EXECUTABLE}" acrobot_ppo.py 2>&1 | \ grep -v ^"No stack."$ && exit 1 - "${PYTHON_EXECUTABLE}" -m unittest discover -s "$RootDir/python/gym_jiminy/unit_py" -v - - name: Python static type checker - if: matrix.PYTHON_VERSION == '3.8' && matrix.BUILD_TYPE == 'Release' + if: matrix.PYTHON_VERSION == '3.8' && matrix.BUILD_TYPE != 'Debug' run: | # Generate stubs stubgen -p jiminy_py -o $RootDir/build/pypi/jiminy_py/src diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b2c2f41a1c..2a2d5a94fa 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -140,7 +140,7 @@ jobs: -p "macosx_${OSX_DEPLOYMENT_TARGET//./_}_${WHEEL_ARCH}" "${RootDir}/build/wheelhouse/"*.whl "${PYTHON_EXECUTABLE}" -m pip install --force-reinstall --no-deps "${RootDir}/build/wheelhouse/"*.whl - name: Upload the wheel for Linux of jiminy_py - if: matrix.BUILD_TYPE == 'Release' + if: matrix.BUILD_TYPE != 'Debug' uses: actions/upload-artifact@v4 with: name: wheelhouse-${{ matrix.PYTHON_VERSION }} @@ -175,24 +175,20 @@ jobs: cd "${RootDir}/python/jiminy_py/unit_py" "${PYTHON_EXECUTABLE}" -m unittest discover -v - - name: Run unit tests for gym_jiminy - if: matrix.BUILD_TYPE != 'Release' + - name: Run unit tests for gym jiminy base module run: | - # 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. - cd "${RootDir}/python/gym_jiminy/unit_py" - "${PYTHON_EXECUTABLE}" -m unittest test_pipeline_design.py -v + export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib" + + "${PYTHON_EXECUTABLE}" -m unittest discover -s "${RootDir}/python/gym_jiminy/unit_py" -v - - name: Run unit tests for gym jiminy - if: matrix.BUILD_TYPE == 'Release' && matrix.PYTHON_VERSION != '3.12' + - name: Run examples for gym jiminy add-on modules + if: matrix.BUILD_TYPE != 'Debug' && matrix.PYTHON_VERSION != '3.12' run: | export LD_LIBRARY_PATH="${InstallDir}/lib/:/usr/local/lib" cd "${RootDir}/python/gym_jiminy/examples/rllib" "${PYTHON_EXECUTABLE}" acrobot_ppo.py - "${PYTHON_EXECUTABLE}" -m unittest discover -s "${RootDir}/python/gym_jiminy/unit_py" -v - ######################################################################################### publish-pypi-macos: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ebc0c8107d..3e57ff55fb 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -81,7 +81,7 @@ jobs: ##################################################################################### - name: PEP8 Code Style Check - if: matrix.OS == 'ubuntu-20.04' && matrix.BUILD_TYPE == 'Release' && matrix.COMPILER == 'gcc' + if: matrix.OS == 'ubuntu-20.04' && matrix.BUILD_TYPE != 'Debug' && matrix.COMPILER == 'gcc' run: | "${PYTHON_EXECUTABLE}" -m pip install flake8 flake8 --ignore=E121,E126,E123,E226,E241,E266,E402,E741,F405,W504 \ @@ -143,14 +143,13 @@ jobs: "${PYTHON_EXECUTABLE}" -m unittest discover -s "${RootDir}/python/jiminy_py/unit_py" -v - - name: Run unit tests for gym_jiminy - if: matrix.BUILD_TYPE != 'Release' + - name: Run unit tests for gym jiminy base module run: | cd "${RootDir}/python/gym_jiminy/unit_py" "${PYTHON_EXECUTABLE}" -m unittest test_pipeline_control.py test_pipeline_design.py -v - - name: Run unit tests for gym_jiminy - if: matrix.BUILD_TYPE == 'Release' + - name: Run examples for gym jiminy add-on modules + if: matrix.BUILD_TYPE != 'Debug' run: | cd "${RootDir}/python/gym_jiminy/examples/rllib" "${PYTHON_EXECUTABLE}" acrobot_ppo.py @@ -160,7 +159,7 @@ jobs: ##################################################################################### - name: Python linter - if: matrix.OS == 'ubuntu-20.04' && matrix.BUILD_TYPE == 'Release' && matrix.COMPILER == 'gcc' + if: matrix.OS == 'ubuntu-20.04' && matrix.BUILD_TYPE != 'Debug' && matrix.COMPILER == 'gcc' run: | cd "${RootDir}/python/jiminy_py/" pylint --rcfile="${RootDir}/.pylintrc" "src/" diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index e260670f70..1db7d810b7 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -141,7 +141,7 @@ jobs: python -m pip install --force-reinstall --no-deps $wheel_path } - name: Upload the wheel for Windows of jiminy_py - if: matrix.BUILD_TYPE == 'Release' + if: matrix.BUILD_TYPE != 'Debug' uses: actions/upload-artifact@v4 with: name: wheelhouse-${{ matrix.PYTHON_VERSION }} @@ -182,24 +182,21 @@ jobs: python -m unittest discover -s "${RootDir}/python/jiminy_py/unit_py" -v - - name: Run unit tests for gym_jiminy - if: matrix.BUILD_TYPE != 'Release' + - name: Run unit tests for gym jiminy base module run: | $RootDir = "${env:GITHUB_WORKSPACE}/workspace" -replace '\\', '/' Set-Location -Path "$RootDir/python/gym_jiminy/unit_py" - python -m unittest test_pipeline_control.py test_pipeline_design.py -v + python -m unittest discover -s "$RootDir/python/gym_jiminy/unit_py" -v - - name: Running unit tests for gym_jiminy - if: matrix.BUILD_TYPE == 'Release' && matrix.PYTHON_VERSION != '3.12' + - name: Run examples for gym jiminy add-on modules + if: matrix.BUILD_TYPE != 'Debug' && matrix.PYTHON_VERSION != '3.12' run: | $RootDir = "${env:GITHUB_WORKSPACE}/workspace" -replace '\\', '/' Set-Location -Path "$RootDir/python/gym_jiminy/examples/rllib" python acrobot_ppo.py - python -m unittest discover -s "$RootDir/python/gym_jiminy/unit_py" -v - ######################################################################################### publish-pypi-win10: