commit
59eb6d13c5
@ -0,0 +1,86 @@
|
||||
# Python package
|
||||
# Create and test a Python package on multiple Python versions.
|
||||
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
|
||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
|
||||
|
||||
jobs:
|
||||
|
||||
- job: 'MitogenTests'
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
strategy:
|
||||
matrix:
|
||||
Mitogen27Debian_27:
|
||||
python.version: '2.7'
|
||||
MODE: mitogen
|
||||
DISTRO: debian
|
||||
|
||||
MitogenPy27CentOS6_26:
|
||||
python.version: '2.7'
|
||||
MODE: mitogen
|
||||
DISTRO: centos6
|
||||
|
||||
#Py26CentOS7:
|
||||
#python.version: '2.7'
|
||||
#MODE: mitogen
|
||||
#DISTRO: centos6
|
||||
|
||||
Mitogen36CentOS6_26:
|
||||
python.version: '3.6'
|
||||
MODE: mitogen
|
||||
DISTRO: centos6
|
||||
|
||||
DebOps_2460_27_27:
|
||||
python.version: '2.7'
|
||||
MODE: debops_common
|
||||
VER: 2.4.6.0
|
||||
|
||||
DebOps_262_36_27:
|
||||
python.version: '3.6'
|
||||
MODE: debops_common
|
||||
VER: 2.6.2
|
||||
|
||||
Ansible_2460_26:
|
||||
python.version: '2.7'
|
||||
MODE: ansible
|
||||
VER: 2.4.6.0
|
||||
|
||||
Ansible_262_26:
|
||||
python.version: '2.7'
|
||||
MODE: ansible
|
||||
VER: 2.6.2
|
||||
|
||||
Ansible_2460_36:
|
||||
python.version: '3.6'
|
||||
MODE: ansible
|
||||
VER: 2.4.6.0
|
||||
|
||||
Ansible_262_36:
|
||||
python.version: '3.6'
|
||||
MODE: ansible
|
||||
VER: 2.6.2
|
||||
|
||||
Vanilla_262_27:
|
||||
python.version: '2.7'
|
||||
MODE: ansible
|
||||
VER: 2.6.2
|
||||
DISTROS: debian
|
||||
STRATEGY: linear
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '$(python.version)'
|
||||
architecture: 'x64'
|
||||
|
||||
- script: .ci/prep_azure.py
|
||||
displayName: "Install requirements."
|
||||
|
||||
- script: |
|
||||
export TRAVIS_BUILD_DIR=`pwd`
|
||||
if [ -f ".ci/$(MODE)_tests.sh" ]; then
|
||||
.ci/$(MODE)_tests.sh;
|
||||
else
|
||||
.ci/$(MODE)_tests.py;
|
||||
fi
|
||||
displayName: Run tests.
|
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
# Run preparation steps in parallel.
|
||||
|
||||
import subprocess
|
||||
import ci_lib
|
||||
|
||||
subprocess.check_call(
|
||||
'echo force-unsafe-io | sudo tee /etc/dpkg/dpkg.cfg.d/nosync',
|
||||
shell=True,
|
||||
)
|
||||
|
||||
procs = [
|
||||
subprocess.Popen(
|
||||
'pip install -r dev_requirements.txt 2>&1 | cat',
|
||||
shell=True,
|
||||
),
|
||||
subprocess.Popen(
|
||||
"""
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa && \
|
||||
( sudo apt-get update 2>&1 | cat ) && \
|
||||
sudo apt-get -y install \
|
||||
python2.6 python2.6-dev libsasl2-dev libldap2-dev 2>&1 | cat
|
||||
""",
|
||||
shell=True,
|
||||
)
|
||||
]
|
||||
|
||||
procs += [
|
||||
subprocess.Popen(
|
||||
'docker pull mitogen/%s-test 2>&1 | cat' % (distro,),
|
||||
shell=True
|
||||
)
|
||||
for distro in ci_lib.DISTROS
|
||||
]
|
||||
|
||||
assert [proc.wait() for proc in procs] == [0] * len(procs)
|
@ -1,55 +0,0 @@
|
||||
# Python package
|
||||
# Create and test a Python package on multiple Python versions.
|
||||
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
|
||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
|
||||
|
||||
jobs:
|
||||
|
||||
- job: 'Test'
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
strategy:
|
||||
matrix:
|
||||
Python27:
|
||||
python.version: '2.7'
|
||||
Python35:
|
||||
python.version: '3.5'
|
||||
Python36:
|
||||
python.version: '3.6'
|
||||
Python37:
|
||||
python.version: '3.7'
|
||||
maxParallel: 4
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '$(python.version)'
|
||||
architecture: 'x64'
|
||||
|
||||
- script: python -m pip install --upgrade pip && pip install -r requirements.txt
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- script: |
|
||||
pip install pytest
|
||||
pytest tests --doctest-modules --junitxml=junit/test-results.xml
|
||||
displayName: 'pytest'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: '**/test-results.xml'
|
||||
testRunTitle: 'Python $(python.version)'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- job: 'Publish'
|
||||
dependsOn: 'Test'
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.x'
|
||||
architecture: 'x64'
|
||||
|
||||
- script: python setup.py sdist
|
||||
displayName: 'Build sdist'
|
Loading…
Reference in New Issue