summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 9667523bcf7c80d9b032bf2645d73da6eb0db8fd (plain)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# yamllint disable rule:line-length
---

conditions: v1

language: python
os: linux
dist: focal
services:
- memcached
_base_envs:
- &stage_lint
  stage: &stage_lint_name lint
- &stage_test
  stage: &stage_test_name test
- &stage_test_priority
  stage: &stage_test_priority_name test against latest Python versions first (under GNU/Linux)
- &stage_test_osx
  stage: &stage_test_osx_name test under OS X (last chance to fail before deploy available)
- &stage_deploy
  stage: &stage_deploy_name upload new version of python package to PYPI (only for tagged commits)
- _conditions:
  - &condition_api_or_cron
    if: type IN (api, cron)
- &no_memcached
  services: []
- &pyenv_base
  <<: *stage_test
  language: generic
  env:
  - &env_pyenv PYENV_ROOT="$HOME/.pyenv"
  - &env_path PATH="$PYENV_ROOT/bin:$PATH"
  before_install:
  - &ensure_pyenv_installed |
    if [ ! -f "$PYENV_ROOT/bin/pyenv" ]
    then
      rm -rf "$PYENV_ROOT"
      curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
    fi
    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"
    pyenv update
  - &install_python pyenv install --skip-existing --keep --verbose "$PYTHON_VERSION"
  - &switch_python pyenv shell "$PYTHON_VERSION"
  - &python_version python --version
- &osx_python_base
  <<: *pyenv_base
  <<: *stage_test_osx
  os: osx
  language: generic
  before_install:
  - brew update
  - brew install pyenv || brew upgrade pyenv
  - &ensure_pyenv_preloaded |
    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"
  - *install_python
  - *switch_python
  - *python_version
  before_cache:
  - brew --cache
  script:
  - travis_retry python -m tox
- &python_3_9_mixture
  python: &mainstream_python 3.9
  group:
- &pure_python_base
  <<: *stage_test
  <<: *python_3_9_mixture
- &pure_python_base_priority
  <<: *pure_python_base
  <<: *stage_test_priority
- &lint_python_base
  <<: *stage_lint
  <<: *no_memcached
  python: 3.9
  after_failure: skip
python:
- 3.7-dev
jobs:
  fast_finish: true
  include:
  - <<: *lint_python_base
    env: TOXENV=pre-commit
  - <<: *lint_python_base
    env: TOXENV=pre-commit-pep257
  - <<: *lint_python_base
    env: TOXENV=dist-check
  - <<: *lint_python_base
    env: TOXENV=setup-check
  - <<: *lint_python_base
    name: >-
      Ensure that docs get built
      (non-strict until \#1797 get fixed)
    env: TOXENV=build-docs
  - <<: *pure_python_base_priority
  # mainstream Python here
  - <<: *pure_python_base_priority
    # mainstream Python here
    # run tests against the bleeding-edge cheroot
    env: TOXENV=cheroot-master
  - <<: *pure_python_base_priority
    python: nightly
  - <<: *osx_python_base
    python: *mainstream_python
    env:
    - PYTHON_VERSION=3.6.5
    - *env_pyenv
    - *env_path
  - <<: *osx_python_base
    python: 3.7-dev
    env:
    - PYTHON_VERSION=3.7-dev
    - *env_pyenv
    - *env_path
  - <<: *osx_python_base
    # mainstream Python here
    python: *mainstream_python
    env:
    - PYTHON_VERSION=3.7.0
    # run tests against the bleeding-edge cheroot
    - TOXENV=cheroot-master
    - *env_pyenv
    - *env_path
  - <<: *stage_deploy
    <<: *python_3_9_mixture
    <<: *no_memcached
    install: skip
    script: skip
    deploy:
      provider: pypi
      skip_cleanup: true
      on:
        tags: true
        all_branches: true
        python: *mainstream_python
      user: __token__
      distributions: dists
      password:
        secure: r9jZVhWnwBpbQwkoAQnhcQajV6Hk8WKs53+P20YrNfLSrSfODmJFyljCLsUJH7TnmAdrnQfV19PXPfVXPucK2ZEg2E91/5z6pgADi01NX3QMr7vEpffk6ix0uHBSa3VMBF+VlmhCzAFnNIN0E7M4kjoc5Cr7qBWPwZpqd715axYxBKSIH4Cmt2cyW3ozMftNtbI+ujs+kJTX6m/2UAL8yngau0TWR5bUBaywTZdkfPIKxt2XDfTW5PuOTRgS6QSU+/Va+M1IJhFPthjmTO+t8U/qonSLA34nLkT7vJmME0lyQF0lr+IV41IKxEFz29hmzLY1dyZI5+bs3vEhxU1xGqwr1Hnif6f14TzeiubQrCxt1UP9D3HXguCNI4gGeny1OPJNNt5ezJDNha2HlIy2quLKgtW38TS0PPm7PDqgYhjidZyRXZ8G6A/DAwh00amCNkSN6lG7Lryd1QB44mYHCKm8XdLfBT94EqzSdgQyyoUAA87A8zB5zpHiRD2DGwrTxHkGQo7TTSVr82cYwkRW0nqE6bZkfNTrGLULB8872ZFGpbSbrAft5mDlSnprLRwrEA0SsFUd4O2W64pcvcJENa/NY+vvXAyd9jaHb5v0RpxUyllLrAIFuLEFHeHwyBAlMgq54dtYWqYa8pyJNoUiwOt158qzOE6wnoburP4KA9c=
cache:
  pip: true
  directories:
  - $HOME/.cache/pre-commit
  - $HOME/Library/Caches/Homebrew
install:
- python -m pip install tox "setuptools>=28.2"
- python -m tox --notest  # Pre-populate a virtualenv with dependencies
script:
- python -m tox
after_failure:
- echo "Here's a list of installed Python packages:"
- pip list --format=columns
- echo Dumping logs, because tests failed to succeed
- |
    for log in `ls cherrypy/test/*.log`
    do
      echo Outputting $log
      cat $log
    done
- py_log=/home/travis/build/cherrypy/cherrypy/.tox/python/log/python-0.log
- echo Outputting python invocation log from $py_log
- cat $py_log
stages:
- *stage_lint_name
- *stage_test_priority_name
- name: *stage_test_name
  <<: *condition_api_or_cron
- name: *stage_test_osx_name
  <<: *condition_api_or_cron
- name: *stage_deploy_name
  if: tag IS present

...