1
- name : macOS ARM64
1
+ name : macOS x86_64
2
2
3
3
on :
4
4
pull_request :
10
10
paths-ignore :
11
11
- ' .github/workflows/build_wheels_linux*'
12
12
- ' .github/workflows/build_wheels_windows*'
13
- - ' .github/workflows/build_wheels_macos .yml'
13
+ - ' .github/workflows/build_wheels_macos_m1 .yml'
14
14
release :
15
15
types : [published, edited]
16
16
schedule :
20
20
21
21
jobs :
22
22
Build :
23
- runs-on : python-macos12-m1
23
+ runs-on : macos-13
24
+ defaults :
25
+ run :
26
+ shell : bash
24
27
strategy :
25
28
fail-fast : false
26
29
matrix :
@@ -30,11 +33,21 @@ jobs:
30
33
without_gui : [0, 1]
31
34
build_sdist : [0]
32
35
env :
33
- CI_BUILD : 1
36
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
37
+ REPO_DIR : .
38
+ PROJECT_SPEC : opencv-python
39
+ MB_PYTHON_VERSION : ${{ matrix.python-version }}
40
+ TRAVIS_PYTHON_VERSION : ${{ matrix.python-version }}
41
+ MB_ML_VER : 2014
42
+ TRAVIS_BUILD_DIR : ${{ github.workspace }}
43
+ TRAVIS_OS_NAME : osx
44
+ CONFIG_PATH : travis_config.sh
45
+ USE_CCACHE : 1
46
+ UNICODE_WIDTH : 32
47
+ PLAT : x86_64
34
48
SDIST : ${{ matrix.build_sdist || 0 }}
35
49
ENABLE_HEADLESS : ${{ matrix.without_gui }}
36
50
ENABLE_CONTRIB : ${{ matrix.with_contrib }}
37
- PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
38
51
steps :
39
52
- name : Cleanup
40
53
run : find . -mindepth 1 -delete
@@ -44,34 +57,46 @@ jobs:
44
57
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
45
58
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
46
59
fi
60
+ # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817
61
+ rm /usr/local/bin/2to3*
62
+ rm /usr/local/bin/idle3*
63
+ rm /usr/local/bin/pydoc3*
64
+ rm /usr/local/bin/python3*
65
+ # end hack
47
66
- name : Checkout
48
67
uses : actions/checkout@v3
49
68
with :
50
69
submodules : false
51
70
fetch-depth : 0
52
71
- name : Build a package
53
72
run : |
73
+ set -e
74
+ # Check out and prepare the source
75
+ # Multibuild doesn't have releases, so --depth would break eventually (see
76
+ # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
54
77
git submodule update --init multibuild
78
+ source multibuild/common_utils.sh
79
+ # https://github.com/matthew-brett/multibuild/issues/116
80
+ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
81
+ source multibuild/travis_steps.sh
82
+ # This sets -x
83
+ # source travis_multibuild_customize.sh
55
84
echo $ENABLE_CONTRIB > contrib.enabled
56
85
echo $ENABLE_HEADLESS > headless.enabled
57
- export MACOSX_DEPLOYMENT_TARGET=13.0
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
60
- delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
61
- - name : Saving all wheels
62
- uses : actions/upload-artifact@v3
63
- with :
64
- name : wheels
65
- path : wheelhouse/opencv*.whl
86
+ set -x
87
+ build_wheel $REPO_DIR $PLAT
66
88
- name : Saving a wheel accordingly to matrix
67
- uses : actions/upload-artifact@v3
89
+ uses : actions/upload-artifact@v4
68
90
with :
69
91
name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
70
92
path : wheelhouse/opencv*.whl
71
93
72
94
Test :
73
95
needs : [Build]
74
- runs-on : python-macos12-m1
96
+ runs-on : macos-13
97
+ defaults :
98
+ run :
99
+ shell : bash
75
100
strategy :
76
101
fail-fast : false
77
102
matrix :
@@ -81,9 +106,14 @@ jobs:
81
106
without_gui : [0, 1]
82
107
build_sdist : [0]
83
108
env :
109
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
110
+ MB_PYTHON_VERSION : ${{ matrix.python-version }}
111
+ NP_TEST_DEP : numpy==1.19.4
112
+ NP_TEST_DEP_LATEST : numpy==2.2.1
113
+ CONFIG_PATH : travis_config.sh
114
+ PLAT : x86_64
84
115
OPENCV_TEST_DATA_PATH : ${{ github.workspace }}/opencv_extra/testdata
85
116
PYLINT_TEST_FILE : ${{ github.workspace }}/opencv/samples/python/squares.py
86
- PIP_INDEX_URL : https://pypi.tuna.tsinghua.edu.cn/simple
87
117
steps :
88
118
- name : Cleanup
89
119
run : find . -mindepth 1 -delete
@@ -93,44 +123,43 @@ jobs:
93
123
with :
94
124
submodules : true
95
125
fetch-depth : 0
126
+ - name : Set up Python ${{ matrix.python-version }}
127
+ uses : actions/setup-python@v4
128
+ with :
129
+ python-version : ${{ matrix.python-version }}
130
+ architecture : ${{ matrix.platform }}
131
+ - name : Setup Environment variables
132
+ run : if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
96
133
- name : Download a wheel accordingly to matrix
97
- uses : actions/download-artifact@v3
134
+ uses : actions/download-artifact@v4
98
135
with :
99
136
name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
100
137
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
105
138
- name : Package installation
106
139
run : |
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
140
+ python -m pip install wheelhouse/opencv*.whl
110
141
cd ${{ github.workspace }}/tests
111
- python${{ matrix.python-version }} get_build_info.py
142
+ python get_build_info.py
112
143
- name : Run tests
113
144
run : |
114
- source ${{ github.workspace }}/opencv_test/bin/activate
115
145
cd ${{ github.workspace }}/opencv
116
- python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
146
+ python modules/python/test/test.py -v --repo .
117
147
- name : Pylint test
118
148
run : |
119
- source ${{ github.workspace }}/opencv_test/bin/activate
120
- python${{ matrix.python-version }} -m pip install pylint==2.15.9
149
+ python -m pip install pylint==2.15.9
121
150
cd ${{ github.workspace }}/tests
122
- python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
151
+ python -m pylint $PYLINT_TEST_FILE
123
152
124
153
Release_rolling :
125
154
if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
126
155
needs : [Build, Test]
127
- runs-on : ubuntu-20 .04
156
+ runs-on : ubuntu-22 .04
128
157
environment : opencv-python-rolling-release
129
158
defaults :
130
159
run :
131
160
shell : bash
132
161
steps :
133
- - uses : actions/download-artifact@v3
162
+ - uses : actions/download-artifact@v4
134
163
with :
135
164
name : wheels
136
165
path : wheelhouse/
@@ -154,13 +183,13 @@ jobs:
154
183
Pre-release :
155
184
if : github.event_name == 'release' && github.event.release.prerelease
156
185
needs : [Build, Test]
157
- runs-on : ubuntu-20 .04
186
+ runs-on : ubuntu-22 .04
158
187
environment : test-opencv-python-release
159
188
defaults :
160
189
run :
161
190
shell : bash
162
191
steps :
163
- - uses : actions/download-artifact@v3
192
+ - uses : actions/download-artifact@v4
164
193
with :
165
194
name : wheels
166
195
path : wheelhouse/
@@ -172,13 +201,13 @@ jobs:
172
201
Release :
173
202
if : github.event_name == 'release' && !github.event.release.prerelease
174
203
needs : [Build, Test]
175
- runs-on : ubuntu-20 .04
204
+ runs-on : ubuntu-22 .04
176
205
environment : opencv-python-release
177
206
defaults :
178
207
run :
179
208
shell : bash
180
209
steps :
181
- - uses : actions/download-artifact@v3
210
+ - uses : actions/download-artifact@v4
182
211
with :
183
212
name : wheels
184
213
path : wheelhouse/
0 commit comments