1
+ name : Python Wheels
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ release :
9
+ types :
10
+ - created
11
+
12
+ env :
13
+ VCPKG_PKGS : >-
14
+ boost-dll boost-program-options
15
+ boost-serialization boost-filesystem
16
+ tinyxml2 console-bridge assimp
17
+ urdfdom octomap orocos-kdl pcl
18
+ gtest benchmark flann jsoncpp
19
+ yaml-cpp
20
+ blas lapack
21
+ fcl ompl taskflow
22
+ bullet3[multithreading,double-precision,rtti]
23
+ ccd[double-precision]
24
+ jobs :
25
+ build-ubuntu :
26
+ runs-on : ${{ matrix.config.runs_on }}
27
+ container : ${{ matrix.config.container }}
28
+ strategy :
29
+ fail-fast : false
30
+ matrix :
31
+ config :
32
+ - os : ubuntu-20.04
33
+ runs_on : ubuntu-latest
34
+ container : ubuntu:20.04
35
+ py_platform : manylinux_2_31_x86_64
36
+ # - os: ubuntu-22.04
37
+ # runs_on: ubuntu-latest
38
+ # container: ubuntu:22.04
39
+ # py_platform: manylinux_2_35_x86_64
40
+ env :
41
+ DEBIAN_FRONTEND : noninteractive
42
+ steps :
43
+ - uses : actions/checkout@v2
44
+ with :
45
+ path : ws/src/tesseract_python
46
+ - name : install sudo, tzdata, keyboard-configuration
47
+ shell : bash
48
+ run : |
49
+ echo -en "XKBMODEL=\"pc105\"\nXKBLAYOUT=\"us\"\nXKBVARIANT=\"\"\nXKBOPTIONS=\"\"\nBACKSPACE=\"guess\"\n" > /etc/default/keyboard
50
+ apt update
51
+ apt install sudo tzdata python3 keyboard-configuration -y -qq
52
+ ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
53
+ dpkg-reconfigure --frontend noninteractive tzdata
54
+ - name : apt
55
+ run : >
56
+ sudo apt-get install python3-pip libboost-all-dev
57
+ libeigen3-dev libtinyxml2-dev libconsole-bridge-dev libassimp-dev
58
+ liburdfdom-dev liboctomap-dev liborocos-kdl-dev libpcl-dev
59
+ libflann-dev libjsoncpp-dev libyaml-cpp-dev git cmake ninja-build
60
+ build-essential autoconf automake libtool bison libpcre2-dev libpcre3-dev
61
+ lcov libbullet-dev libbullet-extras-dev patchelf python3-venv -y -qq
62
+ - name : pip
63
+ run : |
64
+ sudo python3 -m pip install --upgrade pip
65
+ sudo python3 -m pip install auditwheel wheel numpy setuptools colcon-common-extensions vcstool
66
+ - name : vcs import
67
+ working-directory : ws/src
68
+ run : vcs import --input tesseract_python/dependencies_with_ext.rosinstall
69
+ - name : colcon build
70
+ working-directory : ws
71
+ run : >
72
+ colcon build --packages-up-to tesseract_python --merge-install
73
+ --cmake-force-configure
74
+ --packages-ignore bullet
75
+ --event-handlers console_cohesion+
76
+ --cmake-args -DCMAKE_BUILD_TYPE=Release
77
+ -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF
78
+ -DPYTHON_EXECUTABLE=/usr/bin/python3 -DTESSERACT_PYTHON_BUILD_WHEEL=ON
79
+ -DTESSERACT_PYTHON_WHEEL_PLATFORM=${{ matrix.config.py_platform }}
80
+ -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_PLUGIN_FACTORY_CALLBACKS=ON
81
+ - name : test
82
+ shell : bash
83
+ run : |
84
+ python3 -m venv venv
85
+ source venv/bin/activate
86
+ python -m pip install --upgrade pip
87
+ python -m pip install ws/build/tesseract_python/python/wheelhouse/*
88
+ python -m pip install pytest
89
+ export TESSERACT_SUPPORT_DIR=$GITHUB_WORKSPACE/ws/src/tesseract/tesseract_support
90
+ cd ws/src/tesseract_python/tesseract_python
91
+ pytest -s
92
+ - name : archive wheels
93
+ uses : actions/upload-artifact@v2
94
+ with :
95
+ name : ' python-wheels-${{ matrix.config.os }}'
96
+ path : ws/build/tesseract_python/python/*
97
+ build-win :
98
+ runs-on : windows-2019
99
+ strategy :
100
+ fail-fast : false
101
+ matrix :
102
+ config :
103
+ - arch : x64
104
+ vcpkg_triplet : x64-windows-release
105
+ cmake_arch : x64
106
+ python_version : " 3.7"
107
+ - arch : x64
108
+ vcpkg_triplet : x64-windows-release
109
+ cmake_arch : x64
110
+ python_version : " 3.8"
111
+ - arch : x64
112
+ vcpkg_triplet : x64-windows-release
113
+ cmake_arch : x64
114
+ python_version : " 3.9"
115
+ - arch : x64
116
+ vcpkg_triplet : x64-windows-release
117
+ cmake_arch : x64
118
+ python_version : " 3.10"
119
+ steps :
120
+ - uses : actions/checkout@v2
121
+ with :
122
+ path : ws/src/tesseract_python
123
+ - uses : actions/setup-python@v2
124
+ with :
125
+ python-version : ' ${{ matrix.config.python_version }}'
126
+ architecture : ${{ matrix.config.arch }}
127
+ - name : vcpkg build
128
+ uses : johnwason/vcpkg-action@v2
129
+ with :
130
+ pkgs : >-
131
+ ${{ env.VCPKG_PKGS }}
132
+ triplet : ${{ matrix.config.vcpkg_triplet }}
133
+ extra-args : --clean-after-build
134
+ - name : pip3
135
+ run : |
136
+ python -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool
137
+ - name : env python3
138
+ run : echo ("PYTHON3_EXE=" + (Get-Command Python.exe).Path) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
139
+ - name : choco
140
+ run : |
141
+ choco install swig ninja -r
142
+ - name : vcs import
143
+ working-directory : ws/src
144
+ run : vcs import --input tesseract_python\dependencies.rosinstall
145
+ - name : colcon build
146
+ working-directory : ws
147
+ shell : cmd
148
+ run : |
149
+ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
150
+ set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1
151
+ set CMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}
152
+ set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}\bin
153
+ set CC=cl
154
+ set CCX=cl
155
+ colcon build --packages-up-to tesseract_python --merge-install ^
156
+ --cmake-force-configure ^
157
+ --event-handlers console_cohesion+ ^
158
+ --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp gtest ^
159
+ --cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release ^
160
+ -DPYTHON_EXECUTABLE="${{ env.PYTHON3_EXE }}" ^
161
+ -DTESSERACT_PYTHON_BUILD_WHEEL=ON ^
162
+ -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_PLUGIN_FACTORY_CALLBACKS=ON ^
163
+ -DVCPKG_APPLOCAL_DEPS=OFF ^
164
+ -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF
165
+ if %ERRORLEVEL% GEQ 1 exit 1
166
+ - name : test
167
+ shell : cmd
168
+ run : |
169
+ python -m venv venv
170
+ if %errorlevel% neq 0 exit /b %errorlevel%
171
+ call venv\Scripts\activate
172
+ if %errorlevel% neq 0 exit /b %errorlevel%
173
+ python --version
174
+ python -m pip install --upgrade pip
175
+ if %errorlevel% neq 0 exit /b %errorlevel%
176
+ for %%I in ("%GITHUB_WORKSPACE%\ws\build\tesseract_python\python\wheelhouse\*") do set WHEEL_FILE=%%~I
177
+ if %errorlevel% neq 0 exit /b %errorlevel%
178
+ echo WHEEL_FILE=%WHEEL_FILE%
179
+ python -m pip install %WHEEL_FILE%
180
+ if %errorlevel% neq 0 exit /b %errorlevel%
181
+ python -m pip install pytest
182
+ if %errorlevel% neq 0 exit /b %errorlevel%
183
+ set TESSERACT_SUPPORT_DIR=%GITHUB_WORKSPACE%\ws\src\tesseract\tesseract_support
184
+ if %errorlevel% neq 0 exit /b %errorlevel%
185
+ cd %GITHUB_WORKSPACE%\ws\src\tesseract_python\tesseract_python
186
+ if %errorlevel% neq 0 exit /b %errorlevel%
187
+ python -m pytest -s
188
+ if %errorlevel% neq 0 exit /b %errorlevel%
189
+ - name : archive wheels
190
+ if : always()
191
+ uses : actions/upload-artifact@v2
192
+ with :
193
+ name : ' python-wheels-win-${{matrix.config.python_version}}'
194
+ path : ws/build/tesseract_python/python
195
+ - name : archive logs
196
+ if : failure()
197
+ uses : actions/upload-artifact@v2
198
+ with :
199
+ name : ' build-logs-win-${{ matrix.config.arch }}-python-${{ matrix.config.python_version }}'
200
+ path : " **/*.log"
201
+ retention-days : 2
202
+
203
+
204
+
0 commit comments