1- name : Build PYPI wheels for opencv-python
1+ name : Build PYPI wheels for opencv-python on Linux x86_64
22
33on :
44 pull_request :
99
1010
1111jobs :
12- build-windows-x86_64 :
13- runs-on : ${{ matrix.os }}
14- defaults :
15- run :
16- shell : powershell
17-
18- strategy :
19- fail-fast : false
20- matrix :
21- os : [windows-latest]
22- python-version : [3.6, 3.7, 3.8, 3.9]
23- platform : [x86, x64]
24- with_contrib : [0, 1]
25- without_gui : [0, 1]
26- build_sdist : [0]
27-
28- env :
29- ACTIONS_ALLOW_UNSECURE_COMMANDS : true
30- SDIST : ${{ matrix.build_sdist || 0}}
31- ENABLE_HEADLESS : ${{ matrix.without_gui }}
32- ENABLE_CONTRIB : ${{ matrix.with_contrib }}
33-
34- steps :
35- - name : Checkout
36- uses : actions/checkout@v2
37- with :
38- submodules : true
39- fetch-depth : 0
40-
41- - name : Update submodules
42- run : |
43- git submodule update --remote
44-
45- - name : Set up Python ${{ matrix.python-version }}
46- uses : actions/setup-python@v2
47- with :
48- python-version : ${{ matrix.python-version }}
49- architecture : ${{ matrix.platform }}
50-
51- - name : Setup MSBuild.exe
52- uses : warrenbuckley/Setup-MSBuild@v1
53-
54- - name : build script
55- run : |
56- python --version
57- python -m pip install --upgrade pip
58- python -m pip install --upgrade setuptools
59- set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose
60- shell : cmd
61-
62- - name : before test
63- run : |
64- cd ${{ github.workspace }}/tests
65- &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl")
66- if ($LastExitCode -ne 0) {throw $LastExitCode}
67- shell : powershell
68-
69- - name : run test
70- run : |
71- cd ${{ github.workspace }}/tests
72- python -m unittest test
73- shell : cmd
74-
75- - name : saving artifacts
76- uses : actions/upload-artifact@v2
77- with :
78- name : wheels
79- path : wheelhouse/opencv*.whl
80-
8112 build :
8213 runs-on : ${{ matrix.os }}
8314 defaults :
8718 strategy :
8819 fail-fast : false
8920 matrix :
90- os : [ubuntu-latest, macos-latest ]
21+ os : [ubuntu-latest]
9122 python-version : [3.6, 3.7, 3.8, 3.9]
9223 platform : [x64]
9324 with_contrib : [0, 1]
@@ -102,63 +33,41 @@ jobs:
10233 MB_PYTHON_VERSION : ${{ matrix.python-version }}
10334 TRAVIS_PYTHON_VERSION : ${{ matrix.python-version }}
10435 MB_ML_VER : 2014
105- NP_TEST_DEP : numpy
36+ NP_TEST_DEP : numpy==1.19.4
10637 TRAVIS_BUILD_DIR : ${{ github.workspace }}
10738 CONFIG_PATH : travis_config.sh
10839 DOCKER_IMAGE : quay.io/skvark/manylinux2014_${PLAT}
10940 USE_CCACHE : 1
11041 UNICODE_WIDTH : 32
111- SDIST : ${{ matrix.build_sdist || 0}}
42+ SDIST : ${{ matrix.build_sdist || 0 }}
11243 ENABLE_HEADLESS : ${{ matrix.without_gui }}
11344 ENABLE_CONTRIB : ${{ matrix.with_contrib }}
11445
11546 steps :
11647 - name : Checkout
11748 uses : actions/checkout@v2
11849 with :
119- submodules : true
50+ submodules : false
12051 fetch-depth : 0
12152
12253 - name : Update submodules
123- run : |
124- git submodule update --remote
125-
126- - name : Set up Python ${{ matrix.python-version }}
127- uses : actions/setup-python@v2
128- if : ${{ 'macos-latest' == matrix.os }}
129- with :
130- python-version : ${{ matrix.python-version }}
131- architecture : ${{ matrix.platform }}
54+ if : github.event_name == 'pull_request'
55+ run : git submodule update --remote
13256
13357 - name : Setup Environment variables
13458 run : |
135- if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
13659 if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
13760 if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
13861 if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi
139- if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi
14062 echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
14163 echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV;
14264
143- - name : before install
144- run : |
145- set -e
146- # Check out and prepare the source
147- # Multibuild doesn't have releases, so --depth would break eventually (see
148- # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
149- git submodule update --init multibuild
150- source multibuild/common_utils.sh
151- # https://github.com/matthew-brett/multibuild/issues/116
152- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
153- source multibuild/travis_steps.sh
154- # This sets -x
155- # source travis_multibuild_customize.sh
156- echo $ENABLE_CONTRIB > contrib.enabled
157- echo $ENABLE_HEADLESS > headless.enabled
158- set -x
159- build_wheel $REPO_DIR $PLAT
160- install_run $PLAT
161- set +x
65+ - name : build
66+ run : source scripts/build.sh
67+
68+ - name : install and test
69+ run : source scripts/install.sh
70+
16271 - name : saving artifacts
16372 uses : actions/upload-artifact@v2
16473 with :
@@ -191,26 +100,26 @@ jobs:
191100 MB_PYTHON_VERSION : ${{ matrix.python-version }}
192101 TRAVIS_PYTHON_VERSION : ${{ matrix.python-version }}
193102 MB_ML_VER : 2014
194- NP_TEST_DEP : numpy
103+ NP_TEST_DEP : numpy==1.19.4
195104 TRAVIS_BUILD_DIR : ${{ github.workspace }}
196105 CONFIG_PATH : travis_config.sh
197106 DOCKER_IMAGE : quay.io/skvark/manylinux2014_${PLAT}
198107 USE_CCACHE : 1
199108 UNICODE_WIDTH : 32
200- SDIST : ${{ matrix.build_sdist || 0}}
109+ SDIST : ${{ matrix.build_sdist || 0 }}
201110 ENABLE_HEADLESS : ${{ matrix.without_gui || 0 }}
202- ENABLE_CONTRIB : ${{ matrix.with_contrib || 0}}
111+ ENABLE_CONTRIB : ${{ matrix.with_contrib || 0 }}
203112
204113 steps :
205114 - name : Checkout
206115 uses : actions/checkout@v2
207116 with :
208- submodules : true
117+ submodules : false
209118 fetch-depth : 0
210119
211120 - name : Update submodules
212- run : |
213- git submodule update --remote
121+ if : github.event_name == 'pull_request'
122+ run : git submodule update --remote
214123
215124 - name : Set up Python ${{ matrix.python-version }}
216125 uses : actions/setup-python@v2
@@ -220,7 +129,6 @@ jobs:
220129
221130 - name : Setup Environment variables
222131 run : |
223- if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
224132 if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
225133 if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
226134 echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV;
@@ -238,6 +146,7 @@ jobs:
238146 # Install and run tests
239147 set -x
240148 echo "skipping tests because of sdist"
149+
241150 - name : saving artifacts
242151 uses : actions/upload-artifact@v2
243152 with :
@@ -246,7 +155,7 @@ jobs:
246155
247156 test_release_opencv_python :
248157 if : github.event_name == 'release' && github.event.release.prerelease
249- needs : [build, build-windows-x86_64, build_sdist]
158+ needs : [build, build_sdist]
250159 runs-on : ubuntu-latest
251160 environment : test-opencv-python-release
252161 defaults :
@@ -265,7 +174,7 @@ jobs:
265174
266175 release_opencv_python :
267176 if : github.event_name == 'release' && !github.event.release.prerelease
268- needs : [build, build-windows-x86_64, build_sdist]
177+ needs : [build, build_sdist]
269178 runs-on : ubuntu-latest
270179 environment : opencv-python-release
271180 defaults :
0 commit comments