@@ -2,13 +2,11 @@ name: Depthai Python CI/CD
2
2
3
3
# Controls when the action will run. Triggers the workflow on push
4
4
5
- # ##################################
6
- # WARNING #########################
7
- # as self-hosted runners are used, and security policy for them has not been yet determined by GitHub
8
- # pay close attention to not enable workflows on pull_request events
9
- # TLDR: do NOT add 'pull_request' here for the time being
10
5
on :
11
6
workflow_dispatch :
7
+ pull_request :
8
+ branches :
9
+ - v3_develop
12
10
push :
13
11
branches :
14
12
- v3_develop*
27
25
# Job which builds docstrings for the rest of the wheel builds
28
26
build-docstrings :
29
27
runs-on : ubuntu-latest
28
+ env :
29
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
30
30
steps :
31
31
- name : Cache .hunter folder
32
32
uses : actions/cache@v3
35
35
key : hunter-ubuntu-latest-v3-develop
36
36
- name : List .hunter cache directory
37
37
run : ls -a -l ~/.hunter/_Base/ || true
38
+ - name : Export GitHub Actions cache environment variables
39
+ uses : actions/github-script@v7
40
+ with :
41
+ script : |
42
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
43
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
38
44
- uses : actions/checkout@v3
39
45
with :
40
46
submodules : ' recursive'
46
52
run : |
47
53
sudo apt update
48
54
python -m pip install --upgrade pip
49
- sudo apt install libusb-1.0-0-dev libopencv- dev libpcl -dev
55
+ sudo apt install libusb-1.0-0-dev pkg-config bison autoconf libtool libxi- dev libxtst-dev libxrandr-dev libx11-dev libxft-dev libxext-dev nasm flex libudev -dev
50
56
python -m pip install -r bindings/python/docs/requirements_mkdoc.txt
51
57
- name : Configure project
52
58
run : cmake -S . -B build -DDEPTHAI_BUILD_PYTHON=ON -DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON -DDEPTHAI_BASALT_SUPPORT=ON -DDEPTHAI_PCL_SUPPORT=ON -DDEPTHAI_RTABMAP_SUPPORT=ON -DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/bindings/python/docstrings/depthai_python_docstring.hpp"
63
69
# Build and test bindings
64
70
pytest :
65
71
needs : build-docstrings
72
+ env :
73
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
66
74
strategy :
67
75
matrix :
68
76
# os: [ubuntu-latest, windows-latest, macos-latest]
84
92
with :
85
93
path : C:/.hunter/
86
94
key : hunter-pytest-${{ matrix.os }}-v3-develop
95
+ - name : Export GitHub Actions cache environment variables
96
+ uses : actions/github-script@v7
97
+ with :
98
+ script : |
99
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
100
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
87
101
88
102
- uses : actions/checkout@v3
89
103
with :
@@ -105,28 +119,22 @@ jobs:
105
119
if : matrix.os == 'ubuntu-latest'
106
120
run : |
107
121
python -m pip install --upgrade pip
108
- sudo apt install libusb-1.0-0-dev libopencv -dev
122
+ sudo apt install libusb-1.0-0-dev pkg-config bison autoconf libtool libxi-dev libxtst-dev libxrandr-dev libx11-dev libxft-dev libxext-dev nasm flex libudev -dev
109
123
110
124
- name : Install dependencies (MacOS)
111
125
if : matrix.os == 'macos-latest'
112
126
run : |
113
127
python -m pip install --upgrade pip
114
128
brew install libusb
115
- brew install opencv
116
129
117
130
- name : Setup cmake
118
131
if : matrix.os == 'macos-latest'
119
132
120
133
121
- - name : Install dependencies (Windows)
122
- if : matrix.os == 'windows-latest'
123
- run : |
124
- choco install opencv
125
- echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
126
134
127
135
- name : Install pytest
128
136
run : |
129
- python -m pip install pytest numpy opencv-python
137
+ python -m pip install pytest numpy opencv-python jinja2
130
138
131
139
- name : Compile
132
140
run : |
@@ -191,12 +199,15 @@ jobs:
191
199
runs-on : windows-latest
192
200
strategy :
193
201
matrix :
194
- python-version : [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
202
+ python-version : [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13' ]
195
203
# python-architecture: [x64, x86]
196
204
python-architecture : [x64] # TODO(Morato) - re-enable x86 - it complains that OpenCV even though it's 32 bit is not compatible
197
205
fail-fast : false
198
206
env :
199
- DEPTHAI_BUILD_BASALT : ON
207
+ DEPTHAI_BUILD_BASALT : OFF
208
+ DEPTHAI_BUILD_PCL : ON
209
+ DEPTHAI_BUILD_RTABMAP : ON
210
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
200
211
steps :
201
212
- name : Cache .hunter folder
202
213
uses : actions/cache@v3
@@ -206,6 +217,12 @@ jobs:
206
217
- uses : actions/checkout@v3
207
218
with :
208
219
submodules : ' recursive'
220
+ - name : Export GitHub Actions cache environment variables
221
+ uses : actions/github-script@v7
222
+ with :
223
+ script : |
224
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
225
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
209
226
210
227
- uses : actions/download-artifact@v3
211
228
with :
@@ -214,18 +231,6 @@ jobs:
214
231
- name : Specify docstring to use while building the wheel
215
232
run : echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
216
233
217
- - name : Install dependencies for x86
218
- if : matrix.python-architecture == 'x86'
219
- run : |
220
- choco install opencv --x86
221
- echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
222
-
223
- - name : Install dependencies for x64
224
- if : matrix.python-architecture == 'x64'
225
- run : |
226
- choco install opencv
227
- echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
228
-
229
234
- name : Select Windows SDK
230
235
run : echo "CMAKE_ARGS=-DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
231
236
@@ -260,14 +265,15 @@ jobs:
260
265
needs : build-docstrings
261
266
strategy :
262
267
matrix :
263
- python-version : [3.8, 3.9, '3.10', '3.11', '3.12']
268
+ python-version : [3.8, 3.9, '3.10', '3.11', '3.12', '3.13' ]
264
269
os : [macos-13, macos-14] # macos-13 is x64, macos-14 is arm64
265
270
fail-fast : false
266
271
runs-on : ${{ matrix.os }}
267
- # env:
268
- # DEPTHAI_BUILD_BASALT: ON
269
- # DEPTHAI_BUILD_PCL: ON
270
- # DEPTHAI_BUILD_RTABMAP: ON
272
+ env :
273
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
274
+ DEPTHAI_BUILD_BASALT : ON
275
+ DEPTHAI_BUILD_PCL : ON
276
+ DEPTHAI_BUILD_RTABMAP : ON
271
277
steps :
272
278
- name : Cache .hunter folder
273
279
uses : actions/cache@v3
@@ -278,6 +284,12 @@ jobs:
278
284
run : |
279
285
ls -a -l ~/.hunter/_Base/ || true
280
286
echo "PATH=$PATH"
287
+ - name : Export GitHub Actions cache environment variables
288
+ uses : actions/github-script@v7
289
+ with :
290
+ script : |
291
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
292
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
281
293
282
294
- uses : actions/checkout@v3
283
295
with :
@@ -301,8 +313,7 @@ jobs:
301
313
run : |
302
314
python -m pip install --upgrade pip
303
315
brew install libusb
304
- brew install opencv
305
- # brew install pcl
316
+ brew install nasm
306
317
python -m pip install delocate
307
318
- name : Building wheels
308
319
run : cd bindings/python && python -m pip wheel . -w ./wheelhouse/ --verbose
@@ -389,30 +400,34 @@ jobs:
389
400
needs : build-docstrings
390
401
runs-on : ubuntu-latest
391
402
container :
392
- image : mmorato/depthai-manylinux2014:0.4 # TODO(mmorato) temporary location, push to luxonis namespace
403
+ image : quay.io/pypa/manylinux_2_28_x86_64
393
404
env :
394
- PLAT : manylinux2014_x86_64
405
+ PLAT : manylinux_2_28_x86_64
395
406
strategy :
396
407
matrix :
397
- python-set : ["7..9 ", "10..12 "]
408
+ python-set : ["cp37-cp37m ", "cp38-cp38", "cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313 "]
398
409
env :
399
- # workaround required for cache@v3, https://github.com/actions/cache/issues/1428
400
- # to be removed when upgrading the manylinux image
401
- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
402
410
DEPTHAI_BUILD_BASALT : ON
403
411
DEPTHAI_BUILD_PCL : ON
404
412
DEPTHAI_BUILD_RTABMAP : ON
413
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
405
414
steps :
406
415
- name : Cache .hunter folder
407
416
uses : actions/cache@v3
408
417
with :
409
418
path : ~/.hunter
410
419
key : hunter-x86_64-v3-develop
420
+ - name : Export GitHub Actions cache environment variables
421
+ uses : actions/github-script@v7
422
+ with :
423
+ script : |
424
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
425
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
411
426
- uses : actions/checkout@v3
412
427
with :
413
428
submodules : ' recursive'
414
429
- name : Installing libusb1-devel dependency
415
- run : yum install -y --disableplugin=fastestmirror libusb1-devel perl-core curl zip unzip tar ninja-build
430
+ run : yum install -y libusb1-devel perl-core curl zip unzip tar ninja-build zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libXrandr-devel libXtst-devel libudev-devel lapack-devel nasm libtool autoconf automake
416
431
- name : Installing cmake dependency
417
432
run : |
418
433
cd bindings/python
@@ -428,12 +443,15 @@ jobs:
428
443
- name : Specify docstring to use while building the wheel
429
444
run : echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
430
445
446
+ <<<<<<< HEAD
431
447
- name : Build and install depthai-core
432
448
run : |
433
449
cmake -S . -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
434
450
cmake --build build_core --parallel 4
435
451
echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
436
452
453
+ =======
454
+ >>>>>>> v3_develop
437
455
- name : Append build hash if not a tagged commit
438
456
if : startsWith(github.ref, 'refs/tags/v') != true
439
457
run : echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
@@ -444,7 +462,9 @@ jobs:
444
462
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar
445
463
mv dist/* wheelhouse/audited/
446
464
- name : Build wheels
447
- run : cd bindings/python && for PYBIN in /opt/python/cp3{${{ matrix.python-set }}}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
465
+ run : |
466
+ cd bindings/python && for PYBIN in /opt/python/${{ matrix.python-set }}/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
467
+
448
468
- name : Audit wheels
449
469
run : cd bindings/python && for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
450
470
- name : Archive wheel artifacts
@@ -482,35 +502,47 @@ jobs:
482
502
runs-on : [self-hosted, linux, ARM64]
483
503
timeout-minutes : 1440 # Set timeout to 24 hours
484
504
container :
485
- image : mmorato/depthai-manylinux2014_aarch64:0.4
505
+ image : quay.io/pypa/manylinux_2_28_aarch64
486
506
env :
487
- PLAT : manylinux2014_aarch64
507
+ PLAT : manylinux_2_28_aarch64
488
508
# Mount local hunter cache directory, instead of transfering to Github and back
489
509
volumes :
490
510
- /.hunter:/github/home/.hunter
491
511
strategy :
492
512
matrix :
493
- python-set : ["7..9 ", "10..12 "]
513
+ python-set : ["cp37-cp37m ", "cp38-cp38", "cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313 "]
494
514
env :
495
515
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
496
- # to be removed when upgrading the manylinux image
497
- ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
498
- DEPTHAI_VCPKG_CFLAGS : " -std=c99" # Needed so vpckg can bootstrap itself with the old GCC on the manylinux image
499
516
VCPKG_FORCE_SYSTEM_BINARIES : " 1" # Needed so vpckg can bootstrap itself
500
- # DEPTHAI_BUILD_BASALT: ON
501
- # DEPTHAI_BUILD_PCL: ON
502
- # DEPTHAI_BUILD_RTABMAP: ON
517
+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
518
+ DEPTHAI_BUILD_BASALT : ON
519
+ DEPTHAI_BUILD_PCL : ON
520
+ DEPTHAI_BUILD_RTABMAP : ON
521
+ VCPKG_MAX_CONCURRENCY : " 2"
503
522
steps :
523
+ - name : Export GitHub Actions cache environment variables
524
+ uses : actions/github-script@v7
525
+ with :
526
+ script : |
527
+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
528
+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
504
529
- uses : actions/checkout@v3
505
530
with :
506
531
submodules : ' recursive'
507
532
- name : Installing libusb1-devel dependency
508
- run : yum install -y --disableplugin=fastestmirror libusb1-devel perl-core curl zip unzip tar ninja-build
533
+ run : yum install -y libusb1-devel perl-core curl zip unzip tar zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libXrandr-devel libXtst-devel libudev-devel lapack-devel nasm libtool autoconf automake
509
534
- name : Installing cmake dependency
510
535
run : |
511
536
cd bindings/python
512
537
/opt/python/cp38-cp38/bin/python3.8 -m pip install cmake
513
538
ln -s /opt/python/cp38-cp38/bin/cmake /bin/
539
+ - name : Setup ninja required for arm64 builds
540
+ run : |
541
+ git clone https://github.com/ninja-build/ninja.git
542
+ cd ninja
543
+ git checkout v1.10.2
544
+ cmake -Bbuild-cmake
545
+ cmake --build build-cmake --target install
514
546
- name : Create folder structure
515
547
run : cd bindings/python && mkdir -p wheelhouse/audited/
516
548
@@ -521,17 +553,12 @@ jobs:
521
553
- name : Specify docstring to use while building the wheel
522
554
run : echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
523
555
524
- # - name: Build and install depthai-core
525
- # run: |
526
- # cmake -S . -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
527
- # cmake --build build_core --parallel 4
528
- # echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
529
-
530
556
- name : Append build hash if not a tagged commit
531
557
if : startsWith(github.ref, 'refs/tags/v') != true
532
558
run : echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
533
559
- name : Building wheels
534
- run : cd bindings/python && for PYBIN in /opt/python/cp3{${{ matrix.python-set }}}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
560
+ run : |
561
+ cd bindings/python && for PYBIN in /opt/python/${{ matrix.python-set }}/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
535
562
- name : Auditing wheels
536
563
run : cd bindings/python && for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
537
564
- name : Archive wheel artifacts
0 commit comments