summaryrefslogtreecommitdiff
path: root/azure-pipelines.yml
diff options
context:
space:
mode:
authorazure-pipelines[bot] <azure-pipelines[bot]@users.noreply.github.com>2018-09-12 17:26:31 +0000
committerazure-pipelines[bot] <azure-pipelines[bot]@users.noreply.github.com>2018-09-12 17:26:31 +0000
commite6f96e7373e0b6ea1e9ccd2de292f029cb12fac9 (patch)
treebf55c6115c7183f9bbbbbd0f609cdadc9d53ff07 /azure-pipelines.yml
parentb50d41913d31a735c3d02c532ce4ca45f1b04a46 (diff)
downloadcmd2-git-e6f96e7373e0b6ea1e9ccd2de292f029cb12fac9.tar.gz
Set up CI with Azure Pipelines
Diffstat (limited to 'azure-pipelines.yml')
-rw-r--r--azure-pipelines.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 00000000..73a992ed
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,56 @@
+# 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/vsts/pipelines/languages/python
+
+jobs:
+
+- job: 'Test'
+
+ # Configure Build Environment to use Azure Pipelines to build Python project using macOS
+ pool:
+ vmImage: 'macOS 10.13' # other options 'Ubuntu 16.04', 'VS2017-Win2016'
+
+ # Run the pipeline with multiple Python versions
+ strategy:
+ matrix:
+ Python34:
+ python.version: '3.4'
+ Python35:
+ python.version: '3.5'
+ Python36:
+ python.version: '3.6'
+ Python37:
+ python.version: '3.7'
+ # Increase the maxParallel value to simultaneously run the job for all versions in the matrix (max 10 for free open-source)
+ maxParallel: 4
+
+ steps:
+ # Set the UsePythonVersion task to reference the matrix variable for its Python version
+ - task: UsePythonVersion@0
+ inputs:
+ versionSpec: '$(python.version)'
+ architecture: 'x64'
+
+ # Install dependencies - install specific PyPI packages with pip, including cmd2 dependencies
+ - script: |
+ python -m pip install --upgrade pip && pip3 install --upgrade setuptools
+ pip install -e .
+ displayName: 'Upgrade pip and setuptools'
+ continueOnError: false
+
+ # TODO: Consider adding a lint test to use pycodestyle, flake8, or pylint, to check code style conventions
+
+ # Test - test with pytest, collect coverage metrics with pytest-cov, and publish these metrics to codecov.io
+ - script: |
+ pip install pytest pytest-cov pytest-mock codecov
+ py.test tests --cov --junitxml=junit/test-results.xml
+ codecov
+ displayName: 'Run tests and code coverage'
+
+ # Publish test results to the Azure DevOps server
+ - task: PublishTestResults@2
+ inputs:
+ testResultsFiles: '**/test-*.xml'
+ testRunTitle: 'Python $(python.version)'
+ condition: succeededOrFailed()