-
Notifications
You must be signed in to change notification settings - Fork 507
/
.travis.yml
226 lines (196 loc) · 8.33 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# vim:ts=2:sts=2:sw=2:et
#
# Author: Hari Sekhon
# Date: 2014-11-29 01:02:47 +0000 (Sat, 29 Nov 2014)
#
# https://github.com/HariSekhon/Nagios-Plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback
# to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# T r a v i s C I
# ============================================================================ #
# https://docs.travis-ci.com/user/customizing-the-build/
---
version: ~> 1.0
# =============================================
# https://docs.travis-ci.com/user/build-matrix/
# https://docs.travis-ci.com/user/build-stages/matrix-expansion/
matrix:
include:
# ===============================================
# https://docs.travis-ci.com/user/languages/perl/
- os: linux
language: perl
# this build has thread support
perl: "5.24-shrplib"
- os: osx
language: perl
# this build has thread support
perl: "5.24-shrplib"
# ==============================================
# https://docs.travis-ci.com/user/reference/osx/
# macOS 10.15.7 - otherwise defaults to Mac macOS 10.13 with xcode9.4 otherwise - and HomeBrew update takes 50 minutes until the build times out :-/
osx_image: xcode12.2
# matrix include doesn't seem to build the later perl array items for 5.10, so use a separate include for them
#- os: linux
# language: perl
# perl:
# latest Redis cpan module requires Perl >= 5.10
# - "5.10"
# there is workaround in build now to install older version if latest fails for RHEL5/CentOS5 servers
# other CPAN modules are broken for Perl 5.8, re-visit
#- "5.8"
- os: osx
language: perl
perl: "5.24"
# ==============================================
# https://docs.travis-ci.com/user/reference/osx/
# macOS 10.15.7 - otherwise defaults to Mac macOS 10.13 with xcode9.4 otherwise - and HomeBrew update takes 50 minutes until the build times out :-/
osx_image: xcode12.2
# =================================================
# https://docs.travis-ci.com/user/languages/python/
- os: linux
language: python
# numpy has gone 2.7+ only now
python: "2.7"
- os: linux
language: python
python: "3.6"
- os: linux
language: python
python: "pypy"
- os: linux
language: python
python: "pypy3"
- os: linux
language: generic
# =========================================
# https://docs.travis-ci.com/user/multi-os/
# Travis CI doesn't support Python virtual envs on Mac OS X yet, workaround is to use generic and install to system python
# results in a duplicate matrix multiplier giving 2 x osx generic
- os: osx
language: generic
# ==============================================
# https://docs.travis-ci.com/user/reference/osx/
# macOS 10.15.7 - otherwise defaults to Mac macOS 10.13 with xcode9.4 otherwise - and HomeBrew update takes 50 minutes until the build times out :-/
osx_image: xcode12.2
# ===================================================================================================
# https://docs.travis-ci.com/user/multi-os/#allowing-failures-on-jobs-running-on-one-operating-system
allow_failures:
- os: osx
- language: generic
- python: "pypy"
- python: "pypy3"
# =========================================
# https://docs.travis-ci.com/user/multi-os/
#os:
# - linux
# - osx
# =======================================
# https://docs.travis-ci.com/user/docker/
services:
# docker breaks cassandra, mysql, probably everything
# => wholesale switch over to dockerized testing instead
- docker
# - cassandra
# #- couchdb
# - elasticsearch
# - memcached
# - mongodb
# - mysql
# #- postgreql
# - neo4j
# #- rabbitmq
# - redis
# - riak
# ======================================================
# https://docs.travis-ci.com/user/environment-variables/
env:
- DOCKER_COMPOSE_VERSION=1.16.1 PYTHONUNBUFFERED=1 PYTHON_USER_INSTALL=1
# - DEBUG=1
# env vars are handled in docker test scripts now
# - MYSQL_DATABASE=mysql
# - MYSQL_PASSWORD=""
# - MYSQL_USER=travis
# ==============================================
# https://docs.travis-ci.com/user/notifications/
notifications:
email: false
# =================================================================================
# https://docs.travis-ci.com/user/customizing-the-build/#building-specific-branches
# https://docs.travis-ci.com/user/conditional-builds-stages-jobs
#branches:
# only:
# - master
# ========================================
# https://docs.travis-ci.com/user/caching/
before_cache:
#- rm -f $HOME/.cache/pip/log/debug.log
# XXX: cache breaks pypy builds, so clear it
- rm -f $HOME/.cache/pip
cache:
- pip
- directories:
- $HOME/.cache
- $HOME/.cpan
- $HOME/.cpanm
- $HOME/.gem
- bash-tools/pytools_checks
# ==============================================
# https://docs.travis-ci.com/user/job-lifecycle/
before_install:
- sudo rm -f /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
# avoid package checksum mismatches when installing packages
- sudo rm -f "${TRAVIS_ROOT}/etc/apt/apt.conf.d/99-travis-apt-proxy"
- sudo rm -rf "${TRAVIS_ROOT}/var/lib/apt/lists/"*
# /opt/pyenv/shims/pip doesn't trigger sudo or --user but one in the system seems to cause this error so remove it first:
# ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/~ysqlclient-1.3.7.egg-info/PKG-INFO'
# travis yml interprets || to be a map and ignores the line, so quote to prevent that
- "sudo pip uninstall mysqlclient || :"
# after_failure doesn't trigger from install failure
# perlbrew and cpanm are not installed without an install section
# using script section will trigger "after_failure" section but this runs everything regardless of failures
# script:
install:
#- pushd lib
#- make apt-packages
#- cpanm --installdeps --notest . || echo CPANM LIB FAILED
#- popd
#- make apt-packages
#- cpanm --installdeps --notest . || echo CPANM FAILED
# integrated cpanm in to core Makefiles
# workaround for strange error when building pylib submodule, /usr/local/lib/python2.7, /usr/local/man, /usr/lib/python2.7 etc...
# can't do /usr/lib, otherwise /usr/lib/sudo/sudoers.so breaks with "sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner"
# 777 causes "Insecure directory in $ENV{PATH} while running with -T switch at lib/HariSekhonUtils.pm line 1316" - nice catch to this hackery by Perl taint security
#- sudo chmod -R 755 /opt/python /usr/local /usr/lib/python*
# with 755 perms goes back to "error: could not create '/usr/local/lib/python2.7/dist-packages/markupsafe': Permission denied"
# chown root still same error... must be because pure python submodules don't sudo in Travis
#
# Travis has python install before in $PATH even in Perl builds so need to install PyPI modules here otherwise they're not found, but perms not set correctly on Travis build to do this, better than modifying $PATH to put /usr/bin first which is likely to affect many other things including potentially not find the perlbrew installation first
- sudo chown -fR travis /usr/local /usr/lib/python*
# hitting 60 min timeout overall across all builds, retries will mask real error and cut off at random points making debugging harder
#- travis_retry make && travis_retry make zookeeper
- make
- make zookeeper
- make fatpacks
script:
- sudo sysctl -w net.ipv4.conf.all.forwarding=1
# hitting 60 min timeout overall across all builds, retries will mask real error and cut off at random points making debugging harder
- make test
after_success:
- echo "After Success"
after_failure:
- echo "After Failure"
#- for x in /home/travis/.cpanm/work/*/build.log; do echo "uploading $x"; curl -sT "$x" transfer.sh || :; done
# now requires authentication
#curl -sT "$x" chunk.io || :
- make printenv