Skip to content

Commit 5411c90

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ei-npu-support
2 parents 6ec1737 + 794f1ba commit 5411c90

64 files changed

Lines changed: 2822 additions & 4050 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,95 @@
11
name: Build OpenCV Python wheel
22

33
on:
4-
workflow_dispatch:
4+
push:
5+
tags:
6+
- 'opencv/*'
57

68
permissions:
7-
contents: read
9+
contents: write
810

911
jobs:
10-
11-
placeholder:
12+
build-wheels:
1213
runs-on: ubuntu-24.04-arm
14+
container:
15+
image: debian:trixie
16+
options: --user root
17+
timeout-minutes: 180
18+
1319
steps:
14-
- name: Stub build step
15-
run: echo "Actual build steps are defined in another branch."
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Install prerequisites
24+
run: |
25+
apt-get update
26+
apt-get install -y --no-install-recommends gh git ca-certificates build-essential pkg-config ninja-build
27+
28+
- name: Install Python
29+
run: |
30+
apt-get install -y --no-install-recommends python3 python3-dev python3-pip
31+
32+
- name: Install FFmpeg dependencies
33+
run: |
34+
apt-get install -y --no-install-recommends libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
35+
36+
- name: Install Media I/O dependencies
37+
run: |
38+
apt-get install -y --no-install-recommends libjpeg62-turbo-dev libpng-dev libtiff-dev libwebp-dev libopenblas-dev liblapacke-dev
39+
40+
- name: Install GStreamer dependencies
41+
run: |
42+
apt-get install -y --no-install-recommends libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
43+
44+
- name: Clone opencv-python repo
45+
run: |
46+
git clone --depth 1 https://github.com/opencv/opencv-python.git
47+
cd opencv-python
48+
git fetch --depth 1 origin 4ddfc013fd1f13d9b9e379dbebf2cdbeb052e7f8
49+
git checkout 4ddfc013fd1f13d9b9e379dbebf2cdbeb052e7f8
50+
git submodule update --init --recursive --depth 1
51+
52+
- name: Build OpenCV Python wheels
53+
run: |
54+
cd opencv-python
55+
export OPENCV_VERSION=4.13.0
56+
export ENABLE_CONTRIB=0
57+
export ENABLE_HEADLESS=1
58+
export CMAKE_ARGS="-DWITH_GSTREAMER=ON -DWITH_FFMPEG=ON -DWITH_CAROTENE=ON -DWITH_LAPACK=ON -DBUILD_opencv_python3=ON -DWITH_AVIF=OFF -DWITH_GTK=OFF -DWITH_QT=OFF -DWITH_CUDA=OFF -DBUILD_opencv_java=OFF -DWITH_VTK=OFF -DBUILD_opencv_dnn=OFF -DBUILD_opencv_dnn_modern=OFF"
59+
pip3 wheel . --verbose --no-deps
60+
61+
- name: Upload wheel files
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: opencv-python-wheels
65+
path: opencv-python/*.whl
66+
67+
- name: Determine version
68+
id: version
69+
run: |
70+
# Extract version from tag (opencv/4.13.0 -> 4.13.0)
71+
VERSION="${GITHUB_REF#refs/tags/opencv/}"
72+
echo "version=$VERSION" >> $GITHUB_OUTPUT
73+
echo "Release version: $VERSION"
74+
75+
- name: Create or update release
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: |
79+
VERSION="${{ steps.version.outputs.version }}"
80+
TAG="opencv/$VERSION"
81+
REPO="${{ github.repository }}"
82+
83+
# Delete release if it already exists
84+
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
85+
echo "Release $TAG already exists. Deleting..."
86+
gh release delete "$TAG" --repo "$REPO" --yes
87+
fi
88+
89+
# Create release
90+
gh release create "$TAG" \
91+
opencv-python/opencv_python_headless*.whl \
92+
--repo "$REPO" \
93+
--latest=false \
94+
--title "opencv-python-headless $VERSION" \
95+
--notes "OpenCV Python headless wheel version $VERSION optimized for ARM64 architecture with GStreamer and FFmpeg support."

.github/workflows/ci-checks.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,33 @@ permissions:
99
jobs:
1010
ci-checks:
1111
runs-on: ubuntu-24.04-arm
12+
container:
13+
image: python:3.13-slim
14+
options: --user root
1215
env:
13-
PYTHON_VERSION: "3.13"
14-
TASKFILE_VERSION: "v3.44.0"
15-
TASKFILE_PATH: "/home/runner/go/bin"
16+
TASKFILE_VERSION: 'v3.44.0'
17+
TASKFILE_PATH: '/home/runner/go/bin'
1618
steps:
19+
- name: Install git
20+
run: |
21+
apt-get update
22+
apt-get install -y --no-install-recommends --no-install-suggests git ca-certificates curl
23+
git config --global --add safe.directory '*'
24+
1725
- name: Checkout repository
1826
uses: actions/checkout@v4
1927

20-
- name: Set up Python
21-
uses: actions/setup-python@v5
22-
with:
23-
python-version: ${{ env.PYTHON_VERSION }}
24-
2528
- name: Install dependencies
2629
run: |
30+
set -e
2731
which task || curl -sSfL https://taskfile.dev/install.sh | sh -s -- -b ${{ env.TASKFILE_PATH }} ${{ env.TASKFILE_VERSION }}
2832
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
33+
export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
2934
task init:ci
3035
3136
- name: Check code formatting
3237
run: |
38+
set -e
3339
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
3440
task fmt > /dev/null 2>&1
3541
if git diff --quiet; then
@@ -41,22 +47,19 @@ jobs:
4147
4248
- name: Check linting
4349
run: |
50+
set -e
4451
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
45-
task lint > /dev/null 2>&1
52+
task lint > /dev/null 2>&1
4653
if git diff --quiet; then
4754
echo "Code is properly linted."
4855
else
4956
echo "Please lint the code by running 'task lint'."
5057
exit 1
5158
fi
5259
53-
- name: Run tests
54-
run: |
55-
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
56-
task test
57-
5860
- name: Check license headers and files
5961
run: |
62+
set -e
6063
export PATH="${{ env.TASKFILE_PATH }}:$PATH"
6164
task license:headers > /dev/null 2>&1
6265
if git diff --quiet; then
@@ -65,3 +68,9 @@ jobs:
6568
echo "Please update license headers by running 'task license:headers'."
6669
exit 1
6770
fi
71+
72+
- name: Run tests
73+
run: |
74+
useradd -m testuser
75+
chown -R testuser:testuser .
76+
runuser -u testuser -- env PATH="${{ env.TASKFILE_PATH }}:$PATH" task test

.github/workflows/cleanup-cache.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)