Skip to content

Commit

Permalink
(actions) Run multiple python versions (#354)
Browse files Browse the repository at this point in the history
* (actions) run on ubuntu-20.04

Only one python2 job

* (actions) run also python 3.9 and 3.10

* (actions) convert python version to string

* (actions) update LD_LIBRARY_PATH

* (actions) just use python exec

* (actions) which python

* (actions) change order of LD_LIBRARY_PATH

* (actions) empty LD_LIBRARY_PATH

* (actions) env

* (actions) empty LD_LIBRARY_PATH env

* (actions) sudo ldconfig -v

* (actions) print sys.path

* (actions) print get_python_lib path

* (actions) add library path to PYTHONPATH

Needed to use setup-python

* (actions) typo

* (actions) print sys.path

* (actions) export pythonpath

* (actions) export normal sys.path to PYTHONPATH

* (actions) pythonpath

* (actions) pythonpath

* Update main.yml

* (actions) install python packages by pip

* (actions) cleanup

* (actions) remove unused python variable

* (actions) no need to extend LD_LIBRARY_PATH
  • Loading branch information
MatthijsBurgh authored Sep 10, 2021
1 parent 9d05b5a commit 1624d7c
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,38 @@ env:
jobs:
build:
name: Build
runs-on: ubuntu-18.04
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
orocos_build_type: [Debug, Release]
compiler: [gcc, clang]
python_version: ['3.8']
include:
- os: ubuntu-18.04
orocos_build_type: Release
compiler: gcc
python_version: '2'
- os: ubuntu-20.04
orocos_build_type: Release
compiler: gcc
python_version: '3.9'
env:
CC: ${{ matrix.compiler }}
OROCOS_BUILD_TYPE: ${{ matrix.orocos_build_type }}
ROS_PYTHON_VERSION: ${{ matrix.python_version }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: Install
run: |
sudo apt-get install libeigen3-dev libcppunit-dev python-psutil python3-psutil python-future python3-future
sudo apt-get install libeigen3-dev libcppunit-dev
pip install psutil future
- name: Build orocos_kdl
run: |
cd orocos_kdl
Expand All @@ -32,40 +48,26 @@ jobs:
cmake -DENABLE_TESTS:BOOL=ON -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
make
sudo make install
- name: Build PyKDL Python 2
run: |
cd python_orocos_kdl
mkdir build2
cd build2
export ROS_PYTHON_VERSION=2
cmake -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
make
sudo make install
- name: Build PyKDL Python 3
- name: Build PyKDL
run: |
cd python_orocos_kdl
mkdir build3
cd build3
export ROS_PYTHON_VERSION=3
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
make
sudo make install
- name: Update LD_LIBRARY_PATH
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo ldconfig
- name: ldconfig
run: sudo ldconfig
- name: Test orocos_kdl
run: |
cd orocos_kdl/build
make check
- name: Test PyKDL Python 2
run: |
cd python_orocos_kdl
python2 tests/PyKDLtest.py
- name: Test PyKDL Python 3
- name: Test PyKDL
run: |
cd python_orocos_kdl
python3 tests/PyKDLtest.py
python_version_short=$(python -c "import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))")
export PYTHONPATH=/usr/local/lib/python${python_version_short}/dist-packages${PYTHONPATH:+:${PYTHONPATH}}
python tests/PyKDLtest.py
industrial_ci:
name: Industrial CI - ${{ matrix.env.ROS_DISTRO }}
Expand Down

0 comments on commit 1624d7c

Please sign in to comment.