未验证 提交 85b9bc51 编写于 作者: A Andrey Senyaev 提交者: GitHub

Merge pull request #558 from cclauss/patch-2

Travis CI seems to be on vacation
env:
global:
- "PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'"
# pip dependencies to _test_ your project
- TEST_DEPENDS="numpy==1.11.1"
# params to bdist_wheel. used to set osx build target.
- CONFIG_PATH="travis_config.sh"
- USE_CCACHE=1
- UNICODE_WIDTH=32
- SDIST=0
# Save some time, we and setup check them out on demand instead
# https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth
git:
submodules: false
# https://docs.travis-ci.com/user/caching
cache:
directories:
# `cache: ccache: true` has no effect if `language:` is not `c` or `cpp`
- $HOME/.ccache
# Add more cache stages (s2 etc) and corresponding OSX jobs like s1
# if brew builds start to take longer than one Travis time limit
stages:
- final
jobs:
fast_finish: true
# Travis exclude is buggy, this seems to be the only way to disable default build
exclude:
- language: ruby
include:
# default builds for Linux
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.6
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.7
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.8
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.9
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
# headless builds for Linux
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.6
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.7
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.8
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.9
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=0
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
# contrib builds for Linux
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.6
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.7
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.8
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.9
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=0
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
# headless contrib builds for Linux
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.6
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.7
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.8
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
- os: linux
arch: arm64
language: generic
dist: xenial
services: docker
env:
- MB_PYTHON_VERSION=3.9
- PLAT=aarch64
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
- ENABLE_CONTRIB=1
- ENABLE_HEADLESS=1
- TEST_DEPENDS=numpy==1.19.0
- USE_CCACHE=0
cache:
directories: $HOME/.ccache
# The first line is printed in the folding header in Travis output
before_install: |
set -e
if [[ $SDIST == 0 ]]; then
# Check out and prepare the source
# Multibuild doesn't have releases, so --depth would break eventually (see
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
git submodule update --init multibuild
source multibuild/common_utils.sh
# https://github.com/matthew-brett/multibuild/issues/116
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
source multibuild/travis_steps.sh
# This sets -x
source travis_multibuild_customize.sh
echo $ENABLE_CONTRIB > contrib.enabled
echo $ENABLE_HEADLESS > headless.enabled
echo "end"
# Not interested in travis internal scripts' output
fi
set +x
install: |
# Build and package
set -x
if [[ $SDIST == 1 ]]; then
python -m pip install --upgrade pip
python -m pip install scikit-build
python setup.py sdist
else
build_wheel $REPO_DIR $PLAT
fi
set +x
script: |
# Install and run tests
set -x
if [[ $SDIST == 1 ]]; then
echo "skipping tests because of sdist"
else
install_run $PLAT && rc=$? || rc=$?
fi
set +x
#otherwise, Travis logic terminates prematurely
#https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817
trap ERR
test "$rc" -eq 0
after_success: |
# Upload wheels to pypi if tag is set
set -x
if [ -n "$TRAVIS_TAG" ]; then
if [[ $ENABLE_CONTRIB == 0 ]]; then
if [[ $ENABLE_HEADLESS == 0 ]]; then
echo "This is default build. Deployment will be done to to PyPI entry opencv-python."
else
echo "This is headless contrib build. Deployment will be done to to PyPI entry opencv-python-headless."
fi
else
if [[ $ENABLE_HEADLESS == 0 ]]; then
echo "This is contrib build. Deployment will be done to to PyPI entry opencv-contrib-python."
else
echo "This is headless contrib build. Deployment will be done to to PyPI entry opencv-contrib-python-headless."
fi
fi
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ $SDIST == 1 ]]; then
pip install twine
twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv*
else
pip install --user twine
pip install --user --upgrade six
twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv*
fi
fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# macpython 3.5 doesn't support recent TLS protocols which causes twine
# upload to fail, so we use the system Python to run twine
/usr/bin/python -m ensurepip --user
/usr/bin/python -m pip install --user -U pip
/usr/bin/python -m pip install --user -U -I twine
if [[ $SDIST == 1 ]]; then
/usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv*
else
/usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv*
fi
fi
fi
# # Save to Azure storage always
# if [[ $TRAVIS_CPU_ARCH != "arm64" ]]; then
# if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# else
# brew install azure-cli
# fi
# az storage container create -n ${TRAVIS_COMMIT} --public-access blob
# if [[ $SDIST == 1 ]]; then
# az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/dist --pattern *.gz
# else
# az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern opencv*.whl
# fi
# fi
set +x
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册