forked from jupyterhub/kubespawner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
124 lines (108 loc) · 4 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
os: linux
dist: bionic
language: python
python:
- 3.8
stages:
- name: test
if: tag IS NOT present
- name: publish
if: tag IS present
# install dependencies
install:
# 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 --upgrade setuptools pip
- 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
# Log installed python packages' versions
- 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
jobs:
# 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.
- name: client:9,k8s:1.13
env: KUBE_PY=9 KUBE_VERSION=1.13.12
dist: xenial
# 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
- name: client:10,k8s:1.14,py:37
env: KUBE_PY=10 KUBE_VERSION=1.14.0
python: 3.7
- name: client:11,k8s:1.15,py:36
env: &latest_supported KUBE_PY=11 KUBE_VERSION=1.15.12
python: 3.6
- name: client:11,k8s:1.15,jupyterhub:master
env: KUBE_PY=11 KUBE_VERSION=1.15.12 JUPYTERHUB_MASTER=TRUE
- name: client:11,k8s:1.18
env: KUBE_PY=11 KUBE_VERSION=1.18.6
before_install:
# This is required by k8s 1.18 according to minikube error message
# trying to install k8s 1.18 without it.
- sudo apt-get -q -y install conntrack
# Allowed failure tests:
# ----------------------
# 1. Test with pre-releases of kubernetes-client/python and other
# python dependencies
- &allowed_failure_1
name: client:pre-release,k8s:1.16 - allowed failure
env: PRE_RELEASES=TRUE KUBE_VERSION=1.16.13
# 2. Test with a nightly python build using latest known
# supported configuration.
- &allowed_failure_2
name: client:11,k8s:1.15,python:nightly - allowed failure
python: nightly
env: *latest_supported
# Only deploy if all test jobs passed
- stage: publish
script:
- echo "Required dummy override of default 'script' in .travis.yml."
after_success:
- echo "Required dummy override of default 'after_success' in .travis.yml."
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
fast_finish: true