-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
92 lines (78 loc) · 2.52 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
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
notifications:
email: false
cache: pip
sudo: false
###############################################################################
# Anchored and aliased definitions.
###############################################################################
# These are used for avoiding repeating code, and due to problems with
# overriding some keys (in particular, "os" and "language: ptyhon") when using
# the standard travis matrix with stages.
#
# This allows re-using different "sets" of configurations in the stages
# matrix, mimicking a hierarchy:
# * stage_generic
# * stage_linux
# * stage_osx
stage_generic: &stage_generic
install:
# Install step for jobs that require compilation and qa.
- pip install -U -r requirements.txt
- pip install -U -r requirements-dev.txt
script:
# Run the tests
- make test
stage_linux: &stage_linux
<<: *stage_generic
os: linux
dist: trusty
language: python
python: 3.5
stage_osx: &stage_osx
<<: *stage_generic
os: osx
osx_image: xcode9.2
language: generic
before_install:
# Travis does not provide support for Python 3 under osx - it needs to be
# installed manually.
|
if [ ${TRAVIS_OS_NAME} = "osx" ]; then
brew upgrade pyenv || brew install pyenv
pyenv install 3.6.5
~/.pyenv/versions/3.6.5/bin/python -m venv venv
source venv/bin/activate
fi
###############################################################################
# Stage-related definitions
###############################################################################
# Define the order of the stages.
stages:
- lint
- test
# Define the job matrix explicitly, as matrix expansion causes issues when
# using it with stages and some variables/sections cannot be overridden.
jobs:
include:
# "lint and and pure python test" stage
###########################################################################
# Linter and style check (GNU/Linux, Python 3.5)
- stage: lint
<<: *stage_linux
script: make style && make lint
# "test" stage
###########################################################################
# GNU/Linux, Python 3.5
- stage: test
<<: *stage_linux
# GNU/Linux, Python 3.6
- stage: test
<<: *stage_linux
python: 3.6
# OSX, Python 3.latest (brew does not support versioning)
- stage: test
<<: *stage_osx