Skip to content

Commit 1f8dcad

Browse files
authored
Update build_wheels_windows.yml
1 parent 9e5d8db commit 1f8dcad

File tree

1 file changed

+4
-51
lines changed

1 file changed

+4
-51
lines changed

.github/workflows/build_wheels_windows.yml

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -41,87 +41,44 @@ jobs:
4141
rm -rf ./* || true
4242
rm -rf ./.??* || true
4343
working-directory: ${{ github.workspace }}
44-
4544
- name: Setup environment
4645
shell: bash
4746
run: |
4847
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
4948
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
5049
fi
51-
5250
- name: Checkout
5351
uses: actions/checkout@v3
5452
with:
5553
submodules: false
5654
fetch-depth: 0
57-
5855
- name: Set up Python ${{ matrix.python-version }}
5956
uses: actions/setup-python@v4
6057
with:
6158
python-version: ${{ matrix.python-version }}
6259
architecture: ${{ matrix.platform }}
63-
6460
- name: Setup MSBuild.exe
6561
uses: microsoft/[email protected]
66-
6762
- name: Setup NASM
6863
uses: ilammy/setup-nasm@v1
6964

70-
71-
- name: Setup OpenBLAS
72-
shell: cmd
73-
run: |
74-
setlocal enableextensions enabledelayedexpansion
75-
76-
rem Determine correct architecture
77-
if "%{matrix.platform}%"=="x64" (
78-
set ARCH=x64
79-
set FOLDER=win64
80-
) else (
81-
set ARCH=x86
82-
set FOLDER=win32
83-
)
84-
85-
mkdir openblas
86-
cd openblas
87-
curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip
88-
powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ."
89-
90-
set "OpenBLAS_HOME=%CD%"
91-
echo OpenBLAS_HOME=%OpenBLAS_HOME%
92-
set "PATH=%OpenBLAS_HOME%\bin;%PATH%"
93-
94-
if exist %OpenBLAS_HOME%\bin\libopenblas.dll (
95-
copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll
96-
)
97-
echo Listing OpenBLAS directory:
98-
dir %OpenBLAS_HOME%\bin
99-
echo Finished OpenBLAS setup
100-
cd ..
101-
echo set "OpenBLAS_HOME=%OpenBLAS_HOME%" > set_openblas_env.cmd
102-
10365
- name: Build a package
66+
# CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version
10467
run: |
105-
call set_openblas_env.cmd
68+
set "VISUAL_STUDIO=17"
10669
python --version
10770
python -m pip install --upgrade pip
10871
python -m pip install --upgrade setuptools
10972
python -m pip install cmake==3.24.2
11073
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
111-
112-
set "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%"
113-
set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib"
114-
echo %CMAKE_ARGS%
115-
dir
116-
python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v
74+
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
11775
shell: cmd
11876

11977
- name: Saving all wheels
12078
uses: actions/upload-artifact@v4
12179
with:
12280
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
123-
path: |
124-
wheelhouse/opencv*
81+
path: wheelhouse/opencv*
12582

12683
Test:
12784
needs: [Build]
@@ -158,26 +115,22 @@ jobs:
158115
with:
159116
python-version: ${{ matrix.python-version }}
160117
architecture: ${{ matrix.platform }}
161-
162118
- name: Download a wheel accordingly to matrix
163119
uses: actions/download-artifact@v4
164120
with:
165121
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}
166122
path: wheelhouse/
167-
168123
- name: Package installation
169124
run: |
170125
cd ${{ github.workspace }}/tests
171126
&python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl")
172127
if ($LastExitCode -ne 0) {throw $LastExitCode}
173128
python get_build_info.py
174129
shell: powershell
175-
176130
- name: Run tests
177131
run: |
178132
cd ${{ github.workspace }}/opencv
179133
python modules\python\test\test.py -v --repo .
180-
181134
- name: Pylint test
182135
run: |
183136
python -m pip install pylint==2.15.9

0 commit comments

Comments
 (0)