Skip to content

Commit e4eed03

Browse files
committed
Merge branch 'develop' into main
2 parents 719e825 + 9ac0d2c commit e4eed03

File tree

148 files changed

+10588
-471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+10588
-471
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Docker image
2+
on:
3+
push:
4+
branches:
5+
- gen2_develop
6+
jobs:
7+
push_to_registry:
8+
name: Push Docker image to Docker Hub
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
submodules: recursive
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v1
17+
- name: Login to DockerHub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USER }}
21+
password: ${{ secrets.DOCKERHUB_PASS }}
22+
- name: Build and push
23+
uses: docker/build-push-action@v2
24+
with:
25+
push: true
26+
file: ci/Dockerfile
27+
tags: luxonis/depthai-library:latest

.github/workflows/docker-hub.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish Docker image
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
push_to_registry:
8+
name: Push Docker image to Docker Hub
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
submodules: recursive
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v1
17+
- name: Login to DockerHub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USER }}
21+
password: ${{ secrets.DOCKERHUB_PASS }}
22+
- name: Get Version
23+
id: vars
24+
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
25+
- name: Build and push
26+
uses: docker/build-push-action@v2
27+
with:
28+
push: true
29+
file: ci/Dockerfile
30+
tags: luxonis/depthai-library:${{ steps.vars.outputs.short_ref }}

.github/workflows/main.yml

Lines changed: 119 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python Wheel CI
1+
name: Depthai Python CI/CD
22

33
# Controls when the action will run. Triggers the workflow on push
44

@@ -7,15 +7,58 @@ name: Python Wheel CI
77
# as self-hosted runners are used, and security policy for them has not been yet determined by GitHub
88
# pay close attention to not enable workflows on pull_request events
99
# TLDR: do NOT add 'pull_request' here for the time being
10-
on: [push]
10+
on:
11+
workflow_dispatch:
12+
push:
13+
branches:
14+
- main
15+
- develop
16+
- gen2
17+
- gen2_develop
18+
tags:
19+
- 'v*'
20+
1121
###################################
1222
###################################
1323

1424
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1525
jobs:
1626

27+
# Job which builds docstrings for the rest of the wheel builds
28+
build-docstrings:
29+
runs-on: macos-latest
30+
steps:
31+
- name: Cache .hunter folder
32+
uses: actions/cache@v2
33+
with:
34+
path: ~/.hunter/
35+
key: hunter-clang
36+
- uses: actions/checkout@v2
37+
with:
38+
submodules: 'recursive'
39+
- name: Set up Python
40+
uses: actions/setup-python@v2
41+
with:
42+
python-version: 3.8
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
brew install libusb
47+
python -m pip install git+git://github.com/luxonis/pybind11_mkdoc.git@master
48+
- name: Configure project
49+
run: cmake -S . -B build -DDEPTHAI_PYTHON_BUILD_DOCSTRINGS=ON -DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON -DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/docstrings/depthai_python_docstring.hpp"
50+
- name: Build target 'pybind11_mkdoc'
51+
run: cmake --build build --parallel --target pybind11_mkdoc
52+
- name: Upload docstring artifacts
53+
uses: actions/upload-artifact@v2
54+
with:
55+
name: docstrings
56+
path: docstrings/
57+
retention-days: 1
58+
1759
# This job builds wheels for armhf arch (RPi)
1860
build-linux-armhf:
61+
needs: build-docstrings
1962
runs-on: luxonis-armhf
2063
container:
2164
image: registry.gitlab.com/luxonis/depthai-crosscompile/debian-buster
@@ -28,6 +71,14 @@ jobs:
2871
- uses: actions/checkout@v2
2972
with:
3073
submodules: 'recursive'
74+
75+
- uses: actions/download-artifact@v2
76+
with:
77+
name: 'docstrings'
78+
path: docstrings
79+
- name: Specify docstring to use while building the wheel
80+
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
81+
3182
- name: Append build hash if not a tagged commit
3283
if: startsWith(github.ref, 'refs/tags/v') != true
3384
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
@@ -43,10 +94,11 @@ jobs:
4394

4495
# This job builds wheels for Windows x86_64 arch
4596
build-windows-x86_64:
97+
needs: build-docstrings
4698
runs-on: windows-latest
4799
strategy:
48100
matrix:
49-
python-version: [3.6, 3.7, 3.8, 3.9]
101+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
50102
python-architecture: [x64, x86]
51103
steps:
52104
- name: Cache .hunter folder
@@ -57,6 +109,14 @@ jobs:
57109
- uses: actions/checkout@v2
58110
with:
59111
submodules: 'recursive'
112+
113+
- uses: actions/download-artifact@v2
114+
with:
115+
name: 'docstrings'
116+
path: docstrings
117+
- name: Specify docstring to use while building the wheel
118+
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/docstrings/depthai_python_docstring.hpp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
119+
60120
- name: Set up Python ${{ matrix.python-version }}
61121
uses: actions/setup-python@v2
62122
with:
@@ -78,10 +138,11 @@ jobs:
78138

79139
# This job builds wheels for macOS x86_64 arch
80140
build-macos-x86_64:
141+
needs: build-docstrings
81142
runs-on: macos-latest
82143
strategy:
83144
matrix:
84-
python-version: [3.6, 3.7, 3.8, 3.9]
145+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
85146
steps:
86147
- name: Cache .hunter folder
87148
uses: actions/cache@v2
@@ -91,6 +152,14 @@ jobs:
91152
- uses: actions/checkout@v2
92153
with:
93154
submodules: 'recursive'
155+
156+
- uses: actions/download-artifact@v2
157+
with:
158+
name: 'docstrings'
159+
path: docstrings
160+
- name: Specify docstring to use while building the wheel
161+
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
162+
94163
- name: Set up Python ${{ matrix.python-version }}
95164
uses: actions/setup-python@v2
96165
with:
@@ -117,6 +186,7 @@ jobs:
117186

118187
# This job builds wheels for x86_64 arch
119188
build-linux-x86_64:
189+
needs: build-docstrings
120190
runs-on: ubuntu-latest
121191
container:
122192
image: quay.io/pypa/manylinux2014_x86_64
@@ -139,6 +209,14 @@ jobs:
139209
ln -s /opt/python/cp38-cp38/bin/cmake /bin/
140210
- name: Create folder structure
141211
run: mkdir -p wheelhouse/audited/
212+
213+
- uses: actions/download-artifact@v2
214+
with:
215+
name: 'docstrings'
216+
path: docstrings
217+
- name: Specify docstring to use while building the wheel
218+
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
219+
142220
- name: Append build hash if not a tagged commit
143221
if: startsWith(github.ref, 'refs/tags/v') != true
144222
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
@@ -156,7 +234,8 @@ jobs:
156234
name: audited-wheels
157235
path: wheelhouse/audited/
158236

159-
# Run tests
237+
238+
# # Run tests
160239
# tests:
161240
# runs-on: luxonis-arm-tests
162241
# needs: [build-linux-armhf, build-windows-x86_64, build-macos-x86_64, build-linux-x86_64]
@@ -219,3 +298,38 @@ jobs:
219298
PYPI_USER: ${{ secrets.PYPI_USER }}
220299
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
221300

301+
release:
302+
if: startsWith(github.ref, 'refs/tags/v')
303+
needs: [deploy-pypi]
304+
runs-on: ubuntu-latest
305+
306+
steps:
307+
- uses: actions/checkout@v2
308+
with:
309+
submodules: 'recursive'
310+
311+
- name: Get tag version
312+
id: tag
313+
uses: battila7/get-version-action@v2
314+
315+
- name: Check if version matches
316+
run: python3.8 -c 'import find_version as v; exit(0) if "${{ steps.tag.outputs.version-without-v }}" == v.get_package_version() else exit(1)'
317+
318+
# Create GitHub release
319+
- uses: actions/create-release@master
320+
id: createRelease
321+
name: Create ${{ steps.releaseNote.outputs.version }} depthai-core release
322+
env:
323+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
324+
with:
325+
tag_name: ${{ github.ref }}
326+
release_name: Release ${{ github.ref }}
327+
body: |
328+
## Features
329+
330+
## Bugs
331+
332+
## Misc
333+
334+
draft: true
335+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ depthai-core/build/
2323
# builds
2424
_builds/
2525

26+
#git
27+
*.orig
28+
2629
#ci
2730
wheelhouse/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "depthai-core"]
22
path = depthai-core
3-
url = ../depthai-core.git
3+
url = ../../luxonis/depthai-core.git

.readthedocs.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
build:
9+
image: latest
10+
11+
# Submodules
12+
submodules:
13+
include:
14+
- depthai-core
15+
recursive: true
16+
17+
# Build documentation in the docs/ directory with Sphinx
18+
sphinx:
19+
builder: dirhtml
20+
configuration: docs/readthedocs/conf.py
21+
22+
# Build documentation with MkDocs
23+
#mkdocs:
24+
# configuration: mkdocs.yml
25+
26+
# Optionally build your docs in additional formats such as PDF
27+
formats:
28+
- pdf
29+
30+
# Optionally set the version of Python and requirements required to build your docs
31+
python:
32+
version: 3.8
33+
install:
34+
- requirements: docs/readthedocs/requirements.txt

0 commit comments

Comments
 (0)