16
16
- cron : ' 0 3 * * 6'
17
17
workflow_dispatch :
18
18
19
+
19
20
jobs :
20
21
Build :
21
22
runs-on : windows-2019
@@ -34,53 +35,52 @@ jobs:
34
35
ENABLE_CONTRIB : ${{ matrix.with_contrib }}
35
36
OPENCV_TEST_DATA_PATH : ${{ github.workspace }}\opencv_extra\testdata
36
37
steps :
37
- - name : Cleanup
38
- shell : bash
39
- run : |
40
- rm -rf ./* || true
41
- rm -rf ./.??* || true
42
- working-directory : ${{ github.workspace }}
43
-
44
- - name : Setup environment
45
- shell : bash
46
- run : |
47
- if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
48
- echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
49
- fi
50
-
51
- - name : Checkout
52
- uses : actions/checkout@v3
53
- with :
54
- submodules : false
55
- fetch-depth : 0
56
-
57
- - name : Set up Python ${{ matrix.python-version }}
58
- uses : actions/setup-python@v4
59
- with :
60
- python-version : ${{ matrix.python-version }}
61
- architecture : ${{ matrix.platform }}
62
-
63
- - name : Setup MSBuild.exe
64
- uses : microsoft/setup-msbuild@v1.1
65
-
66
- - name : Setup NASM
67
- uses : ilammy/setup-nasm@v1
68
-
69
- - name : Build a package
70
- run : |
71
- python --version
72
- python -m pip install --upgrade pip
73
- python -m pip install --upgrade setuptools
74
- python -m pip install cmake==3.24.2
75
- python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt
76
- set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
77
- shell : cmd
78
-
79
- - name : Upload built wheel
80
- uses : actions/upload-artifact@v4
81
- with :
82
- name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-${{ github.run_id }}-${{ github.job }}
83
- path : wheelhouse/opencv*.whl
38
+ - name : Cleanup
39
+ shell : bash
40
+ run : |
41
+ rm -rf ./* || true
42
+ rm -rf ./.??* || true
43
+ working-directory : ${{ github.workspace }}
44
+ - name : Setup environment
45
+ shell : bash
46
+ run : |
47
+ if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
48
+ echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
49
+ fi
50
+ - name : Checkout
51
+ uses : actions/checkout@v3
52
+ with :
53
+ submodules : false
54
+ fetch-depth : 0
55
+ - name : Set up Python ${{ matrix.python-version }}
56
+ uses : actions/setup-python@v4
57
+ with :
58
+ python-version : ${{ matrix.python-version }}
59
+ architecture : ${{ matrix.platform }}
60
+ - name : Setup MSBuild.exe
61
+ uses : microsoft/setup-msbuild@v1.1
62
+ - name : Setup NASM
63
+ uses : ilammy/setup-nasm@v1
64
+ - name : Build a package
65
+ # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version
66
+ run : |
67
+ python --version
68
+ python -m pip install --upgrade pip
69
+ python -m pip install --upgrade setuptools
70
+ python -m pip install cmake==3.24.2
71
+ python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt
72
+ set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
73
+ shell : cmd
74
+ - name : Saving all wheels
75
+ uses : actions/upload-artifact@v3
76
+ with :
77
+ name : wheels
78
+ path : wheelhouse/opencv*.whl
79
+ - name : Saving a wheel accordingly to matrix
80
+ uses : actions/upload-artifact@v3
81
+ with :
82
+ name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
83
+ path : wheelhouse/opencv*
84
84
85
85
Test :
86
86
needs : [Build]
@@ -101,49 +101,43 @@ jobs:
101
101
OPENCV_TEST_DATA_PATH : ${{ github.workspace }}\opencv_extra\testdata
102
102
PYLINT_TEST_FILE : ${{ github.workspace }}\opencv\samples\python\squares.py
103
103
steps :
104
- - name : Cleanup
105
- shell : bash
106
- run : |
107
- rm -rf ./* || true
108
- rm -rf ./.??* || true
109
- working-directory : ${{ github.workspace }}
110
-
111
- - name : Checkout
112
- uses : actions/checkout@v3
113
- with :
114
- submodules : true
115
- fetch-depth : 0
116
-
117
- - name : Set up Python ${{ matrix.python-version }}
118
- uses : actions/setup-python@v4
119
- with :
120
- python-version : ${{ matrix.python-version }}
121
- architecture : ${{ matrix.platform }}
122
-
123
- - name : Download all artifacts
124
- uses : actions/download-artifact@v3
125
- with :
126
- path : wheelhouse/
127
-
128
- - name : Find and install matching wheel
129
- shell : powershell
130
- run : |
131
- $pattern = "wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-*"
132
- $file = Get-ChildItem -Recurse wheelhouse | Where-Object { $_.Name -like "$pattern*.whl" } | Select-Object -First 1
133
- if (-not $file) { throw "No matching wheel found" }
134
- & python -m pip install --user --no-warn-script-location $file.FullName
135
- python get_build_info.py
136
-
137
- - name : Run tests
138
- run : |
139
- cd ${{ github.workspace }}/opencv
140
- python modules\python\test\test.py -v --repo .
141
-
142
- - name : Pylint test
143
- run : |
144
- python -m pip install pylint==2.15.9
145
- cd ${{ github.workspace }}\tests
146
- python -m pylint $PYLINT_TEST_FILE
104
+ - name : Cleanup
105
+ shell : bash
106
+ run : |
107
+ rm -rf ./* || true
108
+ rm -rf ./.??* || true
109
+ working-directory : ${{ github.workspace }}
110
+ - name : Checkout
111
+ uses : actions/checkout@v3
112
+ with :
113
+ submodules : true
114
+ fetch-depth : 0
115
+ - name : Set up Python ${{ matrix.python-version }}
116
+ uses : actions/setup-python@v4
117
+ with :
118
+ python-version : ${{ matrix.python-version }}
119
+ architecture : ${{ matrix.platform }}
120
+ - name : Download a wheel accordingly to matrix
121
+ uses : actions/download-artifact@v3
122
+ with :
123
+ name : wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
124
+ path : wheelhouse/
125
+ - name : Package installation
126
+ run : |
127
+ cd ${{ github.workspace }}/tests
128
+ &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl")
129
+ if ($LastExitCode -ne 0) {throw $LastExitCode}
130
+ python get_build_info.py
131
+ shell : powershell
132
+ - name : Run tests
133
+ run : |
134
+ cd ${{ github.workspace }}/opencv
135
+ python modules\python\test\test.py -v --repo .
136
+ - name : Pylint test
137
+ run : |
138
+ python -m pip install pylint==2.15.9
139
+ cd ${{ github.workspace }}\tests
140
+ python -m pylint $PYLINT_TEST_FILE
147
141
148
142
Release_rolling :
149
143
if : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -154,15 +148,26 @@ jobs:
154
148
run :
155
149
shell : bash
156
150
steps :
157
- - name : Download all wheels
158
- uses : actions/download-artifact@v3
151
+ - uses : actions/download-artifact@v3
159
152
with :
153
+ name : wheels
160
154
path : wheelhouse/
161
-
162
- - name : Upload wheels
155
+ - name : Upload wheels for opencv_python_rolling
163
156
run : |
164
157
python -m pip install twine
165
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/**/*.whl
158
+ python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
159
+ - name : Upload wheels for opencv_contrib_python_rolling
160
+ run : |
161
+ python -m pip install twine
162
+ python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
163
+ - name : Upload wheels for opencv_python_headless_rolling
164
+ run : |
165
+ python -m pip install twine
166
+ python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
167
+ - name : Upload wheels for opencv_contrib_python_headless_rolling
168
+ run : |
169
+ python -m pip install twine
170
+ python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
166
171
167
172
Pre-release :
168
173
if : github.event_name == 'release' && github.event.release.prerelease
@@ -173,15 +178,14 @@ jobs:
173
178
run :
174
179
shell : bash
175
180
steps :
176
- - name : Download all wheels
177
- uses : actions/download-artifact@v3
181
+ - uses : actions/download-artifact@v3
178
182
with :
183
+ name : wheels
179
184
path : wheelhouse/
180
-
181
- - name : Upload all wheels to Test PyPI
185
+ - name : Upload all wheels
182
186
run : |
183
187
python -m pip install twine
184
- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/**/*.whl
188
+ python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
185
189
186
190
Release :
187
191
if : github.event_name == 'release' && !github.event.release.prerelease
@@ -192,12 +196,23 @@ jobs:
192
196
run :
193
197
shell : bash
194
198
steps :
195
- - name : Download all wheels
196
- uses : actions/download-artifact@v3
199
+ - uses : actions/download-artifact@v3
197
200
with :
201
+ name : wheels
198
202
path : wheelhouse/
199
-
200
- - name : Upload all wheels to PyPI
203
+ - name : Upload wheels for opencv_python
204
+ run : |
205
+ python -m pip install twine
206
+ python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
207
+ - name : Upload wheels for opencv_contrib_python
208
+ run : |
209
+ python -m pip install twine
210
+ python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
211
+ - name : Upload wheels for opencv_python_headless
212
+ run : |
213
+ python -m pip install twine
214
+ python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
215
+ - name : Upload wheels for opencv_contrib_python_headless
201
216
run : |
202
217
python -m pip install twine
203
- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/**/*.whl
218
+ python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
0 commit comments