|
82 | 82 | name: wheels
|
83 | 83 | path: wheelhouse/opencv*.whl
|
84 | 84 |
|
85 |
| - build: |
| 85 | + |
| 86 | + build_linux: |
86 | 87 | runs-on: ${{ matrix.os }}
|
87 | 88 | defaults:
|
88 | 89 | run:
|
|
91 | 92 | strategy:
|
92 | 93 | fail-fast: false
|
93 | 94 | matrix:
|
94 |
| - os: [ubuntu-latest, macos-latest] |
| 95 | + os: [ubuntu-latest] |
95 | 96 | python-version: [3.6, 3.7, 3.8, 3.9]
|
96 | 97 | platform: [x86, x64]
|
97 | 98 | with_contrib: [0, 1]
|
@@ -193,6 +194,117 @@ jobs:
|
193 | 194 | name: wheels
|
194 | 195 | path: wheelhouse/opencv*.whl
|
195 | 196 |
|
| 197 | + build_macos: |
| 198 | + runs-on: ${{ matrix.os }} |
| 199 | + defaults: |
| 200 | + run: |
| 201 | + shell: bash |
| 202 | + |
| 203 | + strategy: |
| 204 | + fail-fast: false |
| 205 | + matrix: |
| 206 | + os: [macos-latest] |
| 207 | + python-version: [3.6, 3.7, 3.8, 3.9] |
| 208 | + platform: [x64] |
| 209 | + with_contrib: [0, 1] |
| 210 | + without_gui: [0, 1] |
| 211 | + build_sdist: [0] |
| 212 | + |
| 213 | + env: |
| 214 | + ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
| 215 | + REPO_DIR: . |
| 216 | + BUILD_COMMIT: master |
| 217 | + PROJECT_SPEC: opencv-python |
| 218 | + MB_PYTHON_VERSION: ${{ matrix.python-version }} |
| 219 | + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} |
| 220 | + MB_ML_VER: 2014 |
| 221 | + NP_TEST_DEP: numpy |
| 222 | + TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 223 | + CONFIG_PATH: travis_config.sh |
| 224 | + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} |
| 225 | + USE_CCACHE: 1 |
| 226 | + UNICODE_WIDTH: 32 |
| 227 | + SDIST: ${{ matrix.build_sdist || 0}} |
| 228 | + ENABLE_HEADLESS: ${{ matrix.without_gui }} |
| 229 | + ENABLE_CONTRIB: ${{ matrix.with_contrib }} |
| 230 | + |
| 231 | + steps: |
| 232 | + - name: Checkout |
| 233 | + uses: actions/checkout@v2 |
| 234 | + with: |
| 235 | + submodules: true |
| 236 | + fetch-depth: 0 |
| 237 | + |
| 238 | + - name: Update submodules |
| 239 | + run: | |
| 240 | + git submodule update --remote |
| 241 | +
|
| 242 | + - name: Set up Python ${{ matrix.python-version }} |
| 243 | + uses: actions/setup-python@v2 |
| 244 | + with: |
| 245 | + python-version: ${{ matrix.python-version }} |
| 246 | + architecture: ${{ matrix.platform }} |
| 247 | + |
| 248 | + - name: Setup Environment variables |
| 249 | + run: | |
| 250 | + if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi |
| 251 | + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi |
| 252 | + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi |
| 253 | + if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi |
| 254 | + if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi |
| 255 | + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; |
| 256 | + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; |
| 257 | +
|
| 258 | + - name: before install |
| 259 | + run: | |
| 260 | + set -e |
| 261 | + if [[ $SDIST == 0 ]]; then |
| 262 | + # Check out and prepare the source |
| 263 | + # Multibuild doesn't have releases, so --depth would break eventually (see |
| 264 | + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) |
| 265 | + git submodule update --init multibuild |
| 266 | + source multibuild/common_utils.sh |
| 267 | + # https://github.com/matthew-brett/multibuild/issues/116 |
| 268 | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi |
| 269 | + source multibuild/travis_steps.sh |
| 270 | + # This sets -x |
| 271 | + # source travis_multibuild_customize.sh |
| 272 | + echo $ENABLE_CONTRIB > contrib.enabled |
| 273 | + echo $ENABLE_HEADLESS > headless.enabled |
| 274 | + echo "end" |
| 275 | + # Not interested in travis internal scripts' output |
| 276 | + fi |
| 277 | + set +x |
| 278 | + # Build and package |
| 279 | + set -x |
| 280 | + ls |
| 281 | + if [[ $SDIST == 1 ]]; then |
| 282 | + python -m pip install --upgrade pip |
| 283 | + python -m pip install scikit-build |
| 284 | + python setup.py sdist |
| 285 | + else |
| 286 | + build_wheel $REPO_DIR $PLAT |
| 287 | + fi |
| 288 | + set +x |
| 289 | + # Install and run tests |
| 290 | + set -x |
| 291 | + if [[ $SDIST == 1 ]]; then |
| 292 | + echo "skipping tests because of sdist" |
| 293 | + rc=0 |
| 294 | + else |
| 295 | + install_run $PLAT && rc=$? || rc=$? |
| 296 | + fi |
| 297 | + set +x |
| 298 | + #otherwise, Travis logic terminates prematurely |
| 299 | + #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 |
| 300 | + trap ERR |
| 301 | + test "$rc" -eq 0 |
| 302 | + - name: saving artifacts |
| 303 | + uses: actions/upload-artifact@v2 |
| 304 | + with: |
| 305 | + name: wheels |
| 306 | + path: wheelhouse/opencv*.whl |
| 307 | + |
196 | 308 |
|
197 | 309 | build_sdist:
|
198 | 310 | runs-on: ${{ matrix.os }}
|
@@ -275,7 +387,7 @@ jobs:
|
275 | 387 |
|
276 | 388 | release:
|
277 | 389 | if: startsWith(github.ref, 'refs/tags/v')
|
278 |
| - needs: [build, build-windows-x86_64, build_sdist] |
| 390 | + needs: [build_linux, build_macos, build-windows-x86_64, build_sdist] |
279 | 391 | runs-on: ubuntu-latest
|
280 | 392 | defaults:
|
281 | 393 | run:
|
|
0 commit comments