From 8981f05ecd79e78c907f3a23b0c49ede6a7cd01d Mon Sep 17 00:00:00 2001 From: Wenbing LI <@wenbingl@outlook.com> Date: Wed, 19 Dec 2018 18:29:10 +0000 Subject: [PATCH 1/2] Set up CI with Azure Pipelines --- azure-pipelines.yml | 74 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..1c04b5b2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,74 @@ +# 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 + +trigger: +- master + +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' + maxParallel: 3 + + steps: + - task: CondaEnvironment@1 + inputs: + createCustomEnvironment: true + environmentName: 'py$(python.version)' + packageSpecs: 'python=$(python.version)' + + - script: | + python -m pip install --upgrade pip + conda config --set always_yes yes --set changeps1 no + conda install -c conda-forge protobuf + conda install -c conda-forge numpy + conda install -c conda-forge cmake + conda install -c conda-forge openmpi + conda install -c conda-forge tensorflow + pip install -r requirements.txt + pip install -r requirements-dev.txt + test '$(python.version)' != '2.7' && pip install onnxruntime + pip install pytest + git clone --recursive https://github.com/cjlin1/libsvm libsvm + cd libsvm + make lib + displayName: 'Install dependencies' + + - script: | + export PYTHONPATH=$PYTHONPATH:libsvm/python + python -c "import svmutil" + test '$(python.version)' != '2.7' && python -c "import onnxruntime" + 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: CondaEnvironment@1 + inputs: + createCustomEnvironment: true + environmentName: 'py$(python.version)' + updateConda: false + + - script: python -u setup.py bdist_wheel + displayName: 'Build bdist_wheel' From 0fbf55872d4b883d181530748e726176dd59b11c Mon Sep 17 00:00:00 2001 From: Wenbing Li Date: Wed, 19 Dec 2018 15:43:17 -0800 Subject: [PATCH 2/2] remove the publish job from the script --- azure-pipelines.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1c04b5b2..3ad16aa2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -57,18 +57,3 @@ jobs: testResultsFiles: '**/test-results.xml' testRunTitle: 'Python $(python.version)' condition: succeededOrFailed() - -- job: 'Publish' - dependsOn: 'Test' - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - task: CondaEnvironment@1 - inputs: - createCustomEnvironment: true - environmentName: 'py$(python.version)' - updateConda: false - - - script: python -u setup.py bdist_wheel - displayName: 'Build bdist_wheel'