Skip to content

Commit

Permalink
[misc] Run all unit tests for gym jiminy base modules on Python 3.12 …
Browse files Browse the repository at this point in the history
…and Debug.
  • Loading branch information
duburcqa committed Mar 13, 2024
1 parent e352bd2 commit f8f390e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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/"
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f8f390e

Please sign in to comment.