Travis configuration now does extra tag validation
Separate build matrix into 3 stages - verify-tag, test, and deploy
verify-tag compares the kubernetes.__version__ to $TRAVIS_TAG. Only
runs on pushed tags
test runs the actual tests
deploy deploys the package to pypi. Only runs on pushed tags
@@ -2,18 +2,29 @@ language: python
dist: xenial
services:
- docker
-matrix:
+
+install:
+- pip install tox
+
+script:
+- tox
+
+jobs:
include:
- - python: 2.7
- env: TOXENV=py27
- - python: 2.7
- env: TOXENV=py27-functional
- - python: 2.7
+ - stage: verify-tag
+ python: 3.7
+ script: [ "v$(python -c 'import kubernetes ; print(kubernetes.__version__)')" == "${TRAVIS_TAG}" ]
+ - stage: test
+ python: 2.7
env: TOXENV=update-pycodestyle
- python: 3.7
env: TOXENV=docs
- python: 2.7
env: TOXENV=coverage,codecov
+ - python: 2.7
+ env: TOXENV=py27
+ - python: 2.7
+ env: TOXENV=py27-functional
- python: 3.5
env: TOXENV=py35
- python: 3.5
@@ -30,10 +41,8 @@ matrix:
env: TOXENV=py38
- python: 3.8
env: TOXENV=py38-functional
-install:
-- pip install tox
-script:
-- tox
+ - stage: deploy
+ script: skip
deploy:
provider: pypi
user: __token__
@@ -44,3 +53,10 @@ deploy:
tags: true
repo: kubernetes-client/python
distributions: sdist bdist_wheel
+
+stages:
+- name: verify-tag
+ if: (tag is present) and (type = push)
+- test
+- name: deploy
+ if: (tag is present) and (type = push)
