-
Notifications
You must be signed in to change notification settings - Fork 29
/
.travis.yml
140 lines (122 loc) · 3.85 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
branches:
only:
- master
- devel
- /devel-.*/
- /travis.*/
- /ci-.*/
language: shell
os: linux
dist: bionic
arch:
- amd64
- arm64
- ppc64le
# Disabled until the scheduling issues are fixed:
# https://travis-ci.community/t/s390x-build-fails-to-get-queued/9533
# - s390x
stages:
- precache
- test
jobs:
include:
- script: true
after_script: true
stage: precache
env: PYTHON=3.8
arch: arm64
- script: true
after_script: true
stage: precache
env: PYTHON=3.7
arch: arm64
- script: true
after_script: true
stage: precache
env: PYTHON=3.6
arch: arm64
env:
jobs:
- PYTHON=3.8
- PYTHON=3.7
- PYTHON=3.6
global:
- PYTHONWARNINGS="ignore::DeprecationWarning"
- PIP_PROGRESS_BAR="off"
- COVERALLS_PARALLEL=true
# Cache downloaded and built python packages
# This needs to be explicit, 'cache: pip' only works with 'language: python'
cache:
directories:
- $HOME/.cache/pip
addons:
apt:
packages:
- graphviz
before_install:
- lscpu
- |
# Install venv on Linux using Ubuntu distributed python
if [ "$TRAVIS_CPU_ARCH" != "amd64" ]; then
# There are a lot fewer wheels distributed for non-x86 architectures.
# We end up building a lot of them locally, install dev packages
export EXTRA_PKGS="build-essential gfortran llvm-10-dev libfreetype6-dev libjpeg-dev liblapack-dev zlib1g-dev"
# Export LLVM_CONFIG for llvmlite
export LLVM_CONFIG=llvm-config-10
# Disable coverage
export RUN_COV=""
# matplotlib depends on cython
export EXTRA_PIP="cython"
fi
# distutils is only needed for python3.8
# https://bugs.launchpad.net/ubuntu/+source/python3.8/+bug/1851684
sudo apt-get install -y python$PYTHON-dev python$PYTHON-venv python$PYTHON-distutils $EXTRA_PKGS
python$PYTHON -m venv $HOME/venv
# Provide fake xdg-open
- echo "#!/bin/sh" > $HOME/venv/bin/xdg-open
- chmod +x $HOME/venv/bin/xdg-open
# The rest of the setup is common for all environments
- source $HOME/venv/bin/activate
- python --version
- pip install -U pip wheel
- pip --version
- |
# Install undeclared dependencies
if [ "x$EXTRA_PIP" != "x" ]; then
pip install $EXTRA_PIP
fi
before_cache:
- pip cache info
- |
INSTALLED=`pip list | sed 's/-/_/g' | sed 's/ */-/' | tail -n+3`
CACHED=`pip cache list | cut -f 2,3 -d- | tail -n+3`
for P in $CACHED; do
# Remove cached and not installed
if [ `echo $INSTALLED | grep -o $P | wc -l` == "0" ] ; then
pip cache remove -v $P
fi
done
- pip cache info
install:
- pip install coveralls
- pip install -e .[dev]
# This should be installed after PNL to avoid pulling incompatible deps
- pip install git+https://github.com/benureau/leabra.git@master
script:
- if [ "x$RUN_COV" != "x" ] ; then echo "Running with coverage"; export COV_ARGS="--cov=psyneulink"; else echo "Running without coverage"; export COV_ARGS=""; fi
# CPU count detection is a mess. pytest-xdist checks for physical cores
# (not threads). However, Travis exposes mixed configurations:
# * amd64: 1s * 1c * 2t = 1c/2t
# * arm64: 1s * 32c * 1t = 32c/32t
# * ppc64le: 2s * 1c * 8t = 2c/16t
# * s390x: 4drawers * 1book * 1s * 1c * 1t = 4c/4t
# 'nproc' should give the correct count, including threads.
# There's also a limit on available memory so the below maxproc numbers
# make sure we don't run out of memory.
- if [ "$TRAVIS_CPU_ARCH" == "ppc64le" ] ; then export MAX_PROCESSES="--maxprocesses=6"; fi
- if [ "$TRAVIS_CPU_ARCH" == "arm64" ] ; then export MAX_PROCESSES="--maxprocesses=16"; fi
- pytest -n `nproc` -p no:logging --verbosity=0 $COV_ARGS $MAX_PROCESSES
after_script:
- if [ "x$RUN_COV" != "x" ] ; then coveralls; fi
notifications:
webhooks: https://coveralls.io/webhook