Skip to content

Commit 1624d7c

Browse files
(actions) Run multiple python versions (#354)
* (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
1 parent 9d05b5a commit 1624d7c

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

.github/workflows/main.yml

+27-25
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,38 @@ env:
88
jobs:
99
build:
1010
name: Build
11-
runs-on: ubuntu-18.04
11+
runs-on: ${{ matrix.os }}
1212
strategy:
1313
fail-fast: false
1414
matrix:
15+
os: [ubuntu-20.04]
1516
orocos_build_type: [Debug, Release]
1617
compiler: [gcc, clang]
18+
python_version: ['3.8']
19+
include:
20+
- os: ubuntu-18.04
21+
orocos_build_type: Release
22+
compiler: gcc
23+
python_version: '2'
24+
- os: ubuntu-20.04
25+
orocos_build_type: Release
26+
compiler: gcc
27+
python_version: '3.9'
1728
env:
1829
CC: ${{ matrix.compiler }}
1930
OROCOS_BUILD_TYPE: ${{ matrix.orocos_build_type }}
31+
ROS_PYTHON_VERSION: ${{ matrix.python_version }}
2032
steps:
2133
- uses: actions/checkout@v2
2234
with:
2335
submodules: recursive
36+
- uses: actions/setup-python@v2
37+
with:
38+
python-version: ${{ matrix.python_version }}
2439
- name: Install
2540
run: |
26-
sudo apt-get install libeigen3-dev libcppunit-dev python-psutil python3-psutil python-future python3-future
41+
sudo apt-get install libeigen3-dev libcppunit-dev
42+
pip install psutil future
2743
- name: Build orocos_kdl
2844
run: |
2945
cd orocos_kdl
@@ -32,40 +48,26 @@ jobs:
3248
cmake -DENABLE_TESTS:BOOL=ON -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
3349
make
3450
sudo make install
35-
- name: Build PyKDL Python 2
36-
run: |
37-
cd python_orocos_kdl
38-
mkdir build2
39-
cd build2
40-
export ROS_PYTHON_VERSION=2
41-
cmake -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
42-
make
43-
sudo make install
44-
- name: Build PyKDL Python 3
51+
- name: Build PyKDL
4552
run: |
4653
cd python_orocos_kdl
47-
mkdir build3
48-
cd build3
49-
export ROS_PYTHON_VERSION=3
54+
mkdir build
55+
cd build
5056
cmake -DCMAKE_BUILD_TYPE=${OROCOS_KDL_BUILD_TYPE} ./..
5157
make
5258
sudo make install
53-
- name: Update LD_LIBRARY_PATH
54-
run: |
55-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
56-
sudo ldconfig
59+
- name: ldconfig
60+
run: sudo ldconfig
5761
- name: Test orocos_kdl
5862
run: |
5963
cd orocos_kdl/build
6064
make check
61-
- name: Test PyKDL Python 2
62-
run: |
63-
cd python_orocos_kdl
64-
python2 tests/PyKDLtest.py
65-
- name: Test PyKDL Python 3
65+
- name: Test PyKDL
6666
run: |
6767
cd python_orocos_kdl
68-
python3 tests/PyKDLtest.py
68+
python_version_short=$(python -c "import sys; print('{}.{}'.format(sys.version_info[0], sys.version_info[1]))")
69+
export PYTHONPATH=/usr/local/lib/python${python_version_short}/dist-packages${PYTHONPATH:+:${PYTHONPATH}}
70+
python tests/PyKDLtest.py
6971
7072
industrial_ci:
7173
name: Industrial CI - ${{ matrix.env.ROS_DISTRO }}

0 commit comments

Comments
 (0)