8000 reformat .travis.yml · opencv/opencv-python@f75e4f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit f75e4f2

Browse files
committed
reformat .travis.yml
1 parent 87815ef commit f75e4f2

File tree

1 file changed

+55
-45
lines changed

1 file changed

+55
-45
lines changed

.travis.yml

Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@ env:
66
- USE_CCACHE=1
77
- PLAT=x86_64
88
- UNICODE_WIDTH=32
9+
910
language: generic
11+
1012
sudo: required
13+
1114
services: docker
15+
1216
dist: trusty
17+
1318
git:
1419
submodules: false
20+
1521
cache:
1622
directories:
1723
- "$HOME/Library/Caches/Homebrew"
1824
- "/usr/local/Homebrew/"
1925
- "$HOME/local_bottle_metadata"
2026
- "$HOME/.ccache"
27+
2128
matrix:
2229
fast_finish: true
2330
include:
@@ -54,24 +61,47 @@ matrix:
5461
cache:
5562
directories: "$HOME/.ccache"
5663

57-
before_install: "# Check out and prepare the source\nset -e\n# Multibuild doesn't
58-
have releases, so --depth would break eventually (see\n# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)\ngit
59-
submodule update --init multibuild\nsource multibuild/common_utils.sh\n# https://github.com/matthew-brett/multibuild/issues/116\nif
60-
[[ \"$TRAVIS_OS_NAME\" == \"osx\" ]]; then export ARCH_FLAGS=\" \"; fi\nsource multibuild/travis_steps.sh\n#
61-
This sets -x\nsource multibuild_customize.sh\necho $ENABLE_CONTRIB > contrib.enabled\necho
62-
$ENABLE_HEADLESS > headless.enabled\n\nif [ -n \"$IS_OSX\" ]; then\n TAPS=\"$(brew
63-
--repository)/Library/Taps\"\n if [ -e \"$TAPS/caskroom/homebrew-cask\" -a -e
64-
\"$TAPS/homebrew/homebrew-cask\" ]; then\n rm -rf \"$TAPS/caskroom/homebrew-cask\"\n
65-
\ fi\n find \"$TAPS\" -type d -name .git -exec \\\n bash -xec '\n
66-
\ cd $(dirname '\\''{}'\\'')\n git clean -fxd\n git
67-
status' \\;\n \n brew_cache_cleanup\nfi\n\nbefore_install\n# Not
68-
interested in travis internal scripts' output\nset +x\n"
64+
# The first line is printed in the folding header in Travis output
65+
before_install: |
66+
# Check out and prepare the source
67+
set -e
68+
# Multibuild doesn't have releases, so --depth would break eventually (see
69+
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
70+
git submodule update --init multibuild
71+
source multibuild/common_utils.sh
72+
# https://github.com/matthew-brett/multibuild/issues/116
73+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
74+
source multibuild/travis_steps.sh
75+
# This sets -x
76+
source multibuild_customize.sh
77+
echo $ENABLE_CONTRIB > contrib.enabled
78+
echo $ENABLE_HEADLESS > headless.enabled
79+
80+
if [ -n "$IS_OSX" ]; then
81+
TAPS="$(brew --repository)/Library/Taps"
82+
if [ -e "$TAPS/caskroom/homebrew-cask" -a -e "$TAPS/homebrew/homebrew-cask" ]; then
83+
rm -rf "$TAPS/caskroom/homebrew-cask"
84+
fi
85+
find "$TAPS" -type d -name .git -exec \
86+
bash -xec '
87+
cd $(dirname '\''{}'\'')
88+
git clean -fxd
89+
git status' \;
90+
91+
brew_cache_cleanup
92+
fi
93+
94+
before_install
95+
# Not interested in travis internal scripts' output
96+
set +x
97+
6998
install: |
7099
# Build and package
71100
set -x
72101
build_wheel $REPO_DIR $PLAT
73102
if [ -n "$USE_CCACHE" ]; then ccache --show-stats; fi
74103
set +x
104+
75105
script: |
76106
# Install and run tests
77107
set -x
@@ -83,46 +113,26 @@ script: |
83113
trap ERR
84114
85115
test "$rc" -eq 0
86-
before_cache: "# Cleanup dirs to be cached\nset -x\nif [ -n \"$IS_OSX\" ]; then\n\n
87-
\ # When Taps is cached, this dir causes \"Error: file exists\" on `brew update`\n
88-
\ if [ -e \"$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask\"
89-
]; then\n rm -rf \"$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask\"\n
90-
\ fi\n\n brew_cache_cleanup\n \nfi\nset +x\n"
91-
after_success: |
92-
# Upload wheels to pypi if requested
93-
if [ -n "$TRAVIS_TAG" ]; then
94-
set -x
95-
pip install twine
96-
97-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
98-
pip install --upgrade pyOpenSSL
99-
fi
100116
101-
if [[ $ENABLE_CONTRIB == 0 ]]; then
102-
if [[ $ENABLE_HEADLESS == 0 ]]; then
103-
echo "This is default build. Deployment will be done to to PyPI entry opencv-python."
104-
else
105-
echo "This is headless contrib build. Deployment will be done to to PyPI entry opencv-python-headless."
106-
fi
107-
else
108-
if [[ $ENABLE_HEADLESS == 0 ]]; then
109-
echo "This is contrib build. Deployment will be done to to PyPI entry opencv-contrib-python."
110-
else
111-
echo "This is headless contrib build. Deployment will be done to to PyPI entry opencv-contrib-python-headless."
112-
fi
113-
fi
117+
before_cache: |
118+
# Cleanup dirs to be cached
119+
set -x
120+
if [ -n "$IS_OSX" ]; then
121+
# When Taps is cached, this dir causes "Error: file exists" on `brew update`
122+
if [ -e "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask" ]; then
123+
rm -rf "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask"
124+
fi
125+
brew_cache_cleanup
126+
127+
fi
128+
set +x
114129
115-
#twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv*
116-
set +x
117-
else
118-
echo "Tag not set, deployment skipped."
119-
fi
120130
deploy:
121131
provider: releases
122132
api_key:
123133
secure: AtM2g/4gJz2ZR4z6+p9GOkUiBIQGKgpJvkq48CgAeTTjEX0CXxn5XSwat4U8Sxr2QEiWj7giRsZlwW8P5TyPXAZ/R7oy1/hsfHQPpz9PKfrKFRpchgWdqiKfyTJwcTcEgo5VIhWmsnvXhbaQZPRnvAhvZ0b3wHfx/ymbsoyD1oyLJMDWq+K8bPvXni+A+vzv+PsSM4kF+AscjSO3ntVs6lBu7PiXFuz9vmmUY7jDkty3GmPzKA1wav1WNvWklSfiiIZvtGU2wj9iUClhYMibzY9lH4fowG9R2m6L3NjtefFCS17XhANKh6iEm3jVVifMjRvThCuYorEC67HDK3RLVJgwGhGWC5Jbr4Xc7aFTgd7lIftHL/alNcmLmiOpGcle45Uc1sdih1e0r5kkoszUAH+QNBXlN10ayNIP/z8iLv6LgT0qj0RIxvqleAJKawohhPqIPNVeSd+v+Vn7l7zbiYtiiZy03a94nvh1IbXPi6p2QB2uGy1/+3B9eipPiA9yamQh5dx2qP4j30iFUh4kMU2KIPfu2w6es+P5/TCVEebZwD1KqERBlKOCAW4g5EGg4qO2AXKN7as7VBge6KITSUSJogc5GhMgyd0tclON60vLeLpEyVv/C2Sq24WDuS8uy9IFm0vs1pzkCmBxEpFxvOyh20eWkVIpOfVPs27U/l0=
124134
file_glob: true
125-
file: "${TRAVIS_BUILD_DIR}/wheelhouse/opencv/*"
135+
file: "${TRAVIS_BUILD_DIR}/dist"
126136
on:
127137
repo: Swind/opencv-python
128138
tags: true

0 commit comments

Comments
 (0)
0