-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.travis.yml
160 lines (127 loc) · 3.73 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# Copyright (c) 2017-2023 Fernando Pelliccioni
#
branches:
only:
- master
- dev
linux: &linux
os: linux
sudo: required
language: python
python: "3.6"
services:
- docker
osx: &osx
os: osx
sudo: required
language: generic
# language: python
# python: "3.6"
node_js:
- "node"
- "8"
matrix:
include:
- <<: *linux
env: UNIT_TESTS=true
compiler: gcc
python: "2.7"
- <<: *linux
env: UNIT_TESTS=true UPLOAD_PKG=false
compiler: gcc
python: "3.6"
- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1 UNIT_TESTS=true TRAVIS_PYTHON_VERSION=2.7
python: "2.7"
- <<: *osx
osx_image: xcode8.3
env: CONAN_APPLE_CLANG_VERSIONS=8.1 UNIT_TESTS=true TRAVIS_PYTHON_VERSION=3.6
python: "3.6"
install:
- set -e
# - set -x
- |
if [[ "${TRAVIS_OS_NAME}" != "linux" ]]; then
brew update || brew update
brew outdated pyenv || brew upgrade pyenv
brew install pyenv-virtualenv
brew install cmake || true
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
pyenv install 2.7.10
pyenv virtualenv 2.7.10 conan
else
pyenv install 3.6.1
pyenv virtualenv 3.6.1 conan
fi
pyenv rehash
pyenv activate conan
fi
- |
pip install wheel --upgrade
pip install twine --upgrade
pip install cpuid --upgrade
script:
- set -e
# - set -x
# - echo "TRAVIS_BRANCH:"
# - echo "${TRAVIS_BRANCH}"
- |
if [[ "${TRAVIS_OS_NAME}" != "linux" ]]; then
if which pyenv > /dev/null; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
pyenv activate conan
fi
- python -c 'import cpuid; _, b, _, _ = cpuid.cpuid_count(7, 0); print((b >> 29) & 1)'
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
less /proc/cpuinfo
cd ${TRAVIS_BUILD_DIR}
chmod a+x .travis/entrypoint.sh
/usr/bin/docker run --rm -ti -e TRAVIS_PYTHON_VERSION=$TRAVIS_PYTHON_VERSION \
-e UNIT_TESTS=$UNIT_TESTS \
-e UPLOAD_PKG=$UPLOAD_PKG \
-e TRAVIS_BRANCH=${TRAVIS_BRANCH} \
-v ${TRAVIS_BUILD_DIR}:/home/conan/project \
-v ${TRAVIS_BUILD_DIR}/.travis/entrypoint.sh:/tmp/entrypoint.sh lasote/conangcc63 \
/bin/bash \
-c /tmp/entrypoint.sh
else
if [[ "${TRAVIS_BRANCH}" == "dev" ]]; then
# Just for dev branch
pip install --upgrade --index-url https://test.pypi.org/pypi/ cpuid-native
fi
# pip install -v -e .
pip install -e .
# if [[ "${UNIT_TESTS}" == "true" ]]; then
# python test/test_chain.py
# fi
if [[ "${UPLOAD_PKG}" == "true" ]]; then
python setup.py sdist
python setup.py bdist_wheel --universal
fi
fi
- |
if [[ "${UPLOAD_PKG}" == "true" ]]; then
if [[ "${TRAVIS_BRANCH}" == "master" ]]; then
twine upload -u ${PYPI_USER_NAME} -p ${PYPI_PASSWORD} dist/* || true
else
# For Testing Release
# twine upload -r test -u ${PYPI_USER_NAME} -p ${PYPI_PASSWORD} dist/* || true
twine upload -u ${PYPI_USER_NAME} -p ${PYPI_PASSWORD} --repository-url https://test.pypi.org/legacy/ dist/* || true
fi
fi
notifications:
email:
- fpelliccioni@gmail.com
webhooks:
urls: https://webhooks.gitter.im/e/a19dd2b03bf676d2b622
on_success: change
on_failure: always