forked from jupyterhub/kubespawner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
110 lines (100 loc) · 3.64 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
language: python
sudo: required
dist: bionic
# install dependencies
install:
- pip install --upgrade setuptools pip
# Only add the --pre flag if $PRE_RELEASES is specified to test pre-releases
# of dependencies, and only pin kubernetes if $KUBE_PY is specified.
- pip install -e ".[test]" ${PRE_RELEASES:+--pre} ${KUBE_PY:+kubernetes==${KUBE_PY}}
# Allow for testing against the jupyterhub master branch as well
- |
if [ "$JUPYTERHUB_MASTER" == "TRUE" ]; then
pip install https://github.com/jupyterhub/jupyterhub/archive/master.zip
fi
- pip freeze
# run tests
script:
# flake8 runs a very quick code analysis
# without running any of the code it analyses
- flake8 kubespawner
# install kubectl, minikube and start minikube
- source ci/minikube.env
- ./ci/install-kube.sh
- pytest --cov kubespawner -v
# followup
after_success:
- pip install codecov
- codecov
matrix:
# NOTE: We may end up updating these set versions with time, when doing that,
# these links are relevant.
#
# ref: KUBE_VERSION's valid values
# https://github.com/kubernetes/kubernetes/tags
# ref: KUBE_PY's valid values
# https://github.com/kubernetes-client/python#compatibility
include:
# Test the oldest supported python on
# the latest supported kubernetes-client,
# and use the latest supported kubernetes
# version along for the kubernetes-client.
#
# KUBE_PY represent the version of kubernetes-client/python, and client
# version 8 supports k8s API version 1.12, and version 9 supports k8s API
# version 1.13 and so on.
- python: 3.8
env: KUBE_PY=8 KUBE_VERSION=1.12.10
# NOTE: TravisCI's linux kernel, has since 2020 or so, when specifying
# bionic as a distribution, made minikube fail to start a k8s 1.13
# cluster. This is why we use xenial here.
# Reference - a build failure with bionic:
# https://travis-ci.org/jupyterhub/kubespawner/jobs/642305915
- dist: xenial
python: 3.7
env: KUBE_PY=9 KUBE_VERSION=1.13.12
- python: 3.6
env: &latest_supported KUBE_PY=10 KUBE_VERSION=1.14.9
- python: 3.6
env: KUBE_PY=10 KUBE_VERSION=1.14.9 JUPYTERHUB_MASTER=TRUE
# Allowed failure tests:
# ----------------------
# 1. Test with pre-releases of kubernetes-client/python and other
# python dependencies
- &allowed_failure_1
python: 3.8
env: PRE_RELEASES=TRUE KUBE_VERSION=1.15.9
# 2. Test with latest stable kubernetes client along with the latest
# kubernetes cluster version
- &allowed_failure_2
python: 3.8
env: KUBE_PY=10 KUBE_VERSION=1.17.2
# 3. Test with a nightly python build using latest known
# supported configuration.
- &allowed_failure_3
python: nightly
env: *latest_supported
# Only deploy if all test jobs passed
- stage: deploy
if: tag IS present
python: 3.7
# FIXME: We don't want to run tests again here, but I got
# the following issue when these were commented out...
# https://travis-ci.org/mapbox/vtvalidate/jobs/492280599
#script: []
#after_success: []
deploy:
provider: pypi
user: __token__
# password: set by TravisCI's environment variable PYPI_PASSWORD
# ref: https://travis-ci.org/jupyterhub/kubespawner/settings
distributions: sdist bdist_wheel
on:
# Without this we get the note about:
# Skipping a deployment with the pypi provider because this branch is not permitted: <tag>
tags: true
allow_failures:
- *allowed_failure_1
- *allowed_failure_2
- *allowed_failure_3
fast_finish: true