Skip to content

Commit bb4a94c

Browse files
committed
Add VSTS integration
1 parent 98d6e02 commit bb4a94c

File tree

5 files changed

+233
-98
lines changed

5 files changed

+233
-98
lines changed

.travis-osx

-6
This file was deleted.

.travis.yml

+4-49
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
if: tag IS present OR type = pull_request OR (branch = master AND type = push) # we only CI the master, tags and PRs
22

3-
stages:
4-
- test
5-
- name: deploy
6-
if: repo = "tox-dev/tox" AND tag IS present
7-
83
group: travis_latest
94
language: python
105
dist: xenial
@@ -17,69 +12,29 @@ env:
1712

1813
jobs:
1914
include:
20-
- python: 2.7 # 2.7.14 pip 9.0.1
21-
- python: 3.4 # 3.4.6 pip 9.0.1
22-
dist: trusty
23-
- python: 3.5 # 3.5.5 pip 9.0.1
24-
- python: 3.6 # 3.6.3 pip 9.0.1
25-
- python: 3.7 # 3.7.0 pip 10.0.1
2615
- python: 3.8-dev
2716
- python: pypy # 2.7.13 pip 9.0.1
2817
dist: trusty
2918
- python: pypy3 # 3.5.3 pip 9.0.1
3019
dist: trusty
31-
- os: osx
32-
language: generic
33-
- python: 3.7
34-
env: TOXENV=docs
35-
- python: 3.7
36-
env: TOXENV=fix-lint
37-
- python: 3.7
38-
env: TOXENV=package-description
39-
40-
- stage: deploy
41-
python: '3.7'
42-
env:
43-
install: pip install "pip >= 10.0.0"
44-
script: skip
45-
after_success: python -c 'print("All done! ✨✨")'
46-
deploy:
47-
provider: pypi
48-
user: toxdev
49-
distributions: sdist bdist_wheel
50-
skip_upload_docs: true
51-
password:
52-
secure: GpPLWTVHMAOpHh2Jq+cYo9hE6cwTxPJ6fMA+q+ERWHtUAqSC88kBqoZ4DQb0cyFIlN24Z9f5J2vm80Q7Qv2UWCGVKeNaWMWFqvZ+P5czGEn7ARoeTsTaiyKTCC2w/7iDsne7dPcSHT/y8V2fO/35kcwcrc0EGr4peb9GDJ4asTFpffiVzW9l5OjV2+jQn+ihWNA0ujSB3AR4TLexXGH+Gf6O5uEHK/kPJ63NEDbJVEdciWqLbDiU+OwWl5Xb5hFX1fjKQ9dP4zA7SolNsNB6pqs4rLl2aHqKYOt1RYGgjWSvANDXKP7S46Q5LFIPkmt4QbOeWxX63NUMZUmWadbjoAF65q1d9Dq41IemsLmElSqpdfPaLtLgLCbNlgHRLNVH+nJVqxjc3bvdxi28K8DZ9BB9KGmPkrbbj4NB0prsPouKiBkUS9NyoQuDt1EzJ3Rn2FzMOH41X5gIqzdsdxcy+3DV2Bb+eozNgg+51n27ESf7vwiYMW9GFENw/6AcPkxIPYakQu4joJ+327wVfK4t0gdy/m4qu2n0Lx6wOJUdSOcOAT5bPaRBQV92gXAaVUsROKMfrzwlVLuA+GXcnj8fft8aMXem30+N3r7y5FjbiAts345qnbjSWV3w9qEbNjM/Z9mt7z1OfsqCarJ2Mj5wKQyYfewddYMjdk7aPW5/9gQ=
53-
on:
54-
all_branches: true
5520

5621
matrix:
5722
fast_finish: true
5823
allow_failures:
5924
- python: 3.8-dev
6025
- python: pypy
6126
- python: pypy3
62-
- os: osx
6327

64-
# Sadly Travis at the moment does not provide as job filter option git changeset, however we emulate it via bash
65-
# we have two type of tasks to run here
66-
# - test (TOXENV=py) => run only if source/packaging/CI files change
67-
# - linter and documentation -> always build
68-
# if this is a tag build we force full build
6928

7029
before_install:
7130
- python -c 'import sys; print(sys.version)'
72-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source .travis-osx; fi
73-
- export BUILD="setup.py pyproject.toml MANIFEST.in setup.cfg tox.ini .travis.yml appveyor.yml"
74-
- export SRC=$(git diff --name-only $TRAVIS_COMMIT_RANGE -- '*.py' $BUILD | grep -v conf.py | grep -v "tasks/.*.py")
75-
- '[[ "$TOXENV"!="py" || (-n "$SRC" && "$TOXENV"="py") ]] && export RUN="YES"'
7631

7732
install:
78-
- '[ -n "$RUN" ] && pip install --pre -U tox'
79-
- '[ -n "$RUN" ] && tox --notest'
33+
- pip install --pre -U tox
34+
- tox --notest
8035

8136
script:
82-
- '[ -n "$RUN" ] && tox'
37+
- tox
8338

8439
after_success:
85-
- '[[ -n "$RUN" && "$TOXENV"="py" ]] && tox -e coverage,codecov'
40+
- tox -e coverage,codecov

.vsts-ci.yml

+224
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
2+
3+
trigger:
4+
branches:
5+
include:
6+
- '*'
7+
8+
phases:
9+
- phase: lint
10+
queue:
11+
name: 'Hosted Linux Preview'
12+
13+
steps:
14+
- task: UsePythonVersion@0
15+
displayName: setup python
16+
inputs:
17+
versionSpec: '3.7.0-b2'
18+
19+
- script: 'python -c "import sys; import os; os.symlink(sys.executable, os.path.join(os.path.dirname(sys.executable), \"python3.7\"))"'
20+
displayName: link python to python3.7
21+
22+
- script: 'python -m pip install -U tox setuptools'
23+
displayName: install tox
24+
25+
- script: 'tox -e fix-lint'
26+
displayName: run tox
27+
28+
29+
30+
- phase: docs
31+
queue:
32+
name: 'Hosted Linux Preview'
33+
parallel: 2
34+
matrix:
35+
readthedocs:
36+
toxenv: 'docs'
37+
packageDescription:
38+
toxenv: 'package-description'
39+
40+
steps:
41+
- task: UsePythonVersion@0
42+
displayName: setup python
43+
inputs:
44+
versionSpec: '3.7.0-b2'
45+
46+
- script: 'python -c "import sys; import os; os.symlink(sys.executable, os.path.join(os.path.dirname(sys.executable), \"python3.7\"))"'
47+
displayName: link python to python3.7
48+
49+
- script: 'python -m pip install -U tox setuptools'
50+
displayName: install tox
51+
52+
- script: 'tox -e $(toxenv)'
53+
displayName: run tox
54+
55+
- phase: linux
56+
queue:
57+
name: 'Hosted Linux Preview'
58+
parallel: 4
59+
matrix:
60+
python27:
61+
python.version: '2.7'
62+
python34:
63+
python.version: '3.4'
64+
python35:
65+
python.version: '3.5'
66+
python36:
67+
python.version: '3.6'
68+
python37:
69+
python.version: '3.7.0-b2'
70+
71+
steps:
72+
- task: UsePythonVersion@0
73+
displayName: setup python$(python.version)
74+
inputs:
75+
versionSpec: '$(python.version)'
76+
77+
- script: 'python -m pip install -U tox setuptools'
78+
displayName: install tox
79+
80+
- script: 'python -m tox -e py --notest'
81+
displayName: acquire env dependencies
82+
83+
- script: 'python -m tox -e py'
84+
displayName: run tests
85+
86+
- task: PublishTestResults@2
87+
displayName: publish test results
88+
inputs:
89+
testResultsFiles: '.tox/test-results.*.xml'
90+
mergeTestResults: true
91+
testRunTitle: '$(toxenv)'
92+
platform: linux
93+
94+
- script: 'python -m tox -e coverage'
95+
displayName: generate coverage.xml
96+
97+
- script: 'ls . -Ra'
98+
displayName: show
99+
100+
- task: PublishCodeCoverageResults@1
101+
inputs:
102+
codeCoverageTool: 'cobertura'
103+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml'
104+
failIfCoverageEmpty: true
105+
106+
- script: 'python -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-$(python.version)" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=$(python.version)'
107+
displayName: upload codecov
108+
109+
- phase: windows
110+
queue:
111+
name: 'Hosted VS2017'
112+
parallel: 4
113+
matrix:
114+
python27:
115+
python.version: '2.7'
116+
python34:
117+
python.version: '3.4'
118+
python35:
119+
python.version: '3.5'
120+
python36:
121+
python.version: '3.6'
122+
python37:
123+
python.version: '3.7.0-b2'
124+
125+
steps:
126+
- task: UsePythonVersion@0
127+
displayName: setup python$(python.version)
128+
inputs:
129+
versionSpec: '$(python.version)'
130+
131+
- script: 'python -m pip install -U tox setuptools'
132+
displayName: install tox
133+
134+
- script: 'python -m tox -e py --notest'
135+
displayName: acquire env dependencies
136+
137+
- script: 'python -m tox -e py'
138+
displayName: run tests
139+
140+
- task: PublishTestResults@2
141+
displayName: publish test results
142+
inputs:
143+
testResultsFiles: '.tox/test-results.*.xml'
144+
mergeTestResults: true
145+
testRunTitle: '$(toxenv)'
146+
platform: windows
147+
148+
- script: 'python -m tox -e coverage'
149+
displayName: generate coverage.xml
150+
151+
- task: PublishCodeCoverageResults@1
152+
inputs:
153+
codeCoverageTool: 'cobertura'
154+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml'
155+
failIfCoverageEmpty: true
156+
157+
- script: 'python -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-$(python.version)" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=$(python.version)'
158+
displayName: upload codecov
159+
160+
- phase: macOS
161+
queue:
162+
name: 'Hosted macOS Preview'
163+
parallel: 1
164+
matrix:
165+
python:
166+
toxenv: 'py3'
167+
168+
steps:
169+
- script: 'python3 -m pip install -U tox setuptools'
170+
displayName: install tox
171+
172+
- script: 'python3 -m tox -e $(toxenv) --notest'
173+
displayName: acquire env dependencies
174+
175+
- script: 'python3 -m tox -e $(toxenv)'
176+
displayName: run tests
177+
178+
- task: PublishTestResults@2
179+
displayName: publish test results
180+
inputs:
181+
testResultsFiles: '.tox/test-results.*.xml'
182+
mergeTestResults: true
183+
testRunTitle: '$(toxenv)'
184+
platform: windows
185+
186+
- script: 'python3 -m tox -e coverage'
187+
displayName: generate coverage.xml
188+
189+
- task: PublishCodeCoverageResults@1
190+
inputs:
191+
codeCoverageTool: 'cobertura'
192+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml'
193+
failIfCoverageEmpty: true
194+
195+
- script: 'python3 -m tox -e codecov -- -t $(CODECOV_TOKEN) --required -n "$(agent.os)-python3" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=3'
196+
displayName: upload codecov
197+
198+
- phase: publish
199+
dependsOn:
200+
- macOs
201+
- linux
202+
- windows
203+
- lint
204+
- docs
205+
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
206+
queue:
207+
name: 'Hosted Linux Preview'
208+
parallel: 1
209+
matrix:
210+
python37:
211+
python.version: '3.7.0-b2'
212+
213+
steps:
214+
- task: UsePythonVersion@0
215+
displayName: setup python$(python.version)
216+
inputs:
217+
versionSpec: '$(python.version)'
218+
219+
# - task: PyPIPublisher@0
220+
# displayName: Package and publish to PyPI
221+
# inputs:
222+
# pypiConnection: pypi
223+
# packageDirectory: '$(System.DefaultWorkingDirectory)'
224+
# alsoPublishWheel: true

appveyor.yml

-40
This file was deleted.

tox.ini

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE TOXENV CI TRAVIS TRAVIS_
2020
deps =
2121
extras = testing
2222
changedir = {toxinidir}/tests
23-
commands = pytest {posargs:--cov="{envsitepackagesdir}/tox" --cov-config="{toxinidir}/tox.ini" --timeout=180 . -n {env:PYTEST_XDIST_PROC_NR:auto} }
23+
commands = pytest {posargs:--cov="{envsitepackagesdir}/tox" --cov-config="{toxinidir}/tox.ini" --timeout=180 . -n {env:PYTEST_XDIST_PROC_NR:auto} --junitxml={toxworkdir}/test-results.{envname}.xml }
2424

2525
[testenv:docs]
2626
description = invoke sphinx-build to build the HTML docs and check that all links are valid
@@ -37,7 +37,7 @@ deps = readme-renderer >= 21.0
3737
changedir = {toxinidir}
3838
skip_install = true
3939
extras =
40-
commands = python setup.py check -r -s
40+
commands = python setup.py check -r -s
4141

4242
[testenv:fix-lint]
4343
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
@@ -74,10 +74,12 @@ commands = coverage erase
7474

7575
[testenv:codecov]
7676
description = [only run on CI]: upload coverage data to codecov (depends on coverage running first)
77+
passenv = {[testenv]passenv}
78+
CODECOV_TOKEN
7779
deps = codecov
7880
skip_install = True
7981
changedir = {toxinidir}
80-
commands = codecov --file "{toxworkdir}/coverage.xml"
82+
commands = codecov --file "{toxworkdir}/coverage.xml" {posargs}
8183

8284
[testenv:exit_code]
8385
# to see how the InvocationError is displayed, use

0 commit comments

Comments
 (0)