20
20
21
21
jobs :
22
22
Build :
23
- runs-on : opencv-cn-mac-arm64
23
+ runs-on : python-macos11-m1
24
24
strategy :
25
25
fail-fast : false
26
26
matrix :
27
- python-version : ['3.7 ']
27
+ python-version : ['3.9 ']
28
28
platform : [x64]
29
29
with_contrib : [0, 1]
30
30
without_gui : [0, 1]
34
34
SDIST : ${{ matrix.build_sdist || 0 }}
35
35
ENABLE_HEADLESS : ${{ matrix.without_gui }}
36
36
ENABLE_CONTRIB : ${{ matrix.with_contrib }}
37
+ PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
37
38
steps :
38
39
- name : Cleanup
39
40
run : find . -mindepth 1 -delete
54
55
echo $ENABLE_CONTRIB > contrib.enabled
55
56
echo $ENABLE_HEADLESS > headless.enabled
56
57
export MACOSX_DEPLOYMENT_TARGET=11.0
57
- arch -arm64 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin
58
- arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
58
+ python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin
59
+ python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
59
60
delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
60
61
- name : Saving all wheels
61
62
uses : actions/upload-artifact@v3
@@ -74,14 +75,15 @@ jobs:
74
75
strategy :
75
76
fail-fast : false
76
77
matrix :
77
- python-version : ['3.7', '3.8', '3.9', '3.10']
78
+ python-version : ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]
78
79
platform : [x64]
79
80
with_contrib : [0, 1]
80
81
without_gui : [0, 1]
81
82
build_sdist : [0]
82
83
env :
83
84
OPENCV_TEST_DATA_PATH : ${{ github.workspace }}/opencv_extra/testdata
84
85
PYLINT_TEST_FILE : ${{ github.workspace }}/opencv/samples/python/squares.py
86
+ PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
85
87
steps :
86
88
- name : Cleanup
87
89
run : find . -mindepth 1 -delete
@@ -96,20 +98,28 @@ jobs:
96
98
with :
97
99
name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
98
100
path : wheelhouse/
101
+ - name : Create Venv for test
102
+ run : |
103
+ test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test"
104
+ python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test
99
105
- name : Package installation
100
106
run : |
101
- arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl
107
+ source ${{ github.workspace }}/opencv_test/bin/activate
108
+ python${{ matrix.python-version }} -m pip install --upgrade pip
109
+ python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl
102
110
cd ${{ github.workspace }}/tests
103
- arch -arm64 python${{ matrix.python-version }} get_build_info.py
111
+ python${{ matrix.python-version }} get_build_info.py
104
112
- name : Run tests
105
113
run : |
114
+ source ${{ github.workspace }}/opencv_test/bin/activate
106
115
cd ${{ github.workspace }}/opencv
107
- arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
116
+ python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
108
117
- name : Pylint test
109
118
run : |
110
- arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2
119
+ source ${{ github.workspace }}/opencv_test/bin/activate
120
+ python${{ matrix.python-version }} -m pip install pylint==2.15.9
111
121
cd ${{ github.workspace }}/tests
112
- arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
122
+ python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
113
123
114
124
Release_rolling :
115
125
if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
0 commit comments