From 086655e4fc90b864ddf8ad0c4178a99b7b3705b9 Mon Sep 17 00:00:00 2001 From: Kayla Ngan Date: Fri, 9 Nov 2018 16:55:47 -0500 Subject: [PATCH] Unify Linux and Windows --- _azure-pipelines/template-linux.yml | 33 ------------------- _azure-pipelines/template-windows.yml | 36 --------------------- _azure-pipelines/template.yml | 46 +++++++++++++++++++++++++++ azure-pipelines.yml | 10 ++++-- 4 files changed, 54 insertions(+), 71 deletions(-) delete mode 100644 _azure-pipelines/template-linux.yml delete mode 100644 _azure-pipelines/template-windows.yml create mode 100644 _azure-pipelines/template.yml diff --git a/_azure-pipelines/template-linux.yml b/_azure-pipelines/template-linux.yml deleted file mode 100644 index a4658d5f..00000000 --- a/_azure-pipelines/template-linux.yml +++ /dev/null @@ -1,33 +0,0 @@ -jobs: -- job: Linux - pool: - vmImage: 'Ubuntu-16.04' - strategy: - matrix: - Python27: - PYTHON_VERSION: '2.7' - Python34: - PYTHON_VERSION: '3.4' - Python35: - PYTHON_VERSION: '3.5' - Python36: - PYTHON_VERSION: '3.6' - Python37: - PYTHON_VERSION: '3.7' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - displayName: 'Install Python' - - script: | - make - make test-readme - make ci - - script: | - pipenv run codecov - displayName: 'Coverage' - - task: PublishTestResults@2 - displayName: 'Publish test results' - inputs: - testResultsFiles: 'report.xml' - testRunTitle: Python $(PYTHON_VERSION) diff --git a/_azure-pipelines/template-windows.yml b/_azure-pipelines/template-windows.yml deleted file mode 100644 index 1f3b8db2..00000000 --- a/_azure-pipelines/template-windows.yml +++ /dev/null @@ -1,36 +0,0 @@ -jobs: -- job: Windows - pool: - vmImage: 'vs2017-win2016' - strategy: - matrix: - Python27: - PYTHON_VERSION: '2.7' - Python34: - PYTHON_VERSION: '3.4' - Python35: - PYTHON_VERSION: '3.5' - Python36: - PYTHON_VERSION: '3.6' - Python37: - PYTHON_VERSION: '3.7' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - architecture: 'x64' - displayName: 'Install Python' - - script: | - make init - python -m pip install --upgrade pip wheel - displayName: 'Ensure latest' - - script: | - make - pipenv install -e .[socks] --skip-lock - - script: | - make coverage - displayName: 'Test script' - - script: | - pipenv run codecov -f coverage.xml - displayName: 'Coverage' - diff --git a/_azure-pipelines/template.yml b/_azure-pipelines/template.yml new file mode 100644 index 00000000..ed6c632d --- /dev/null +++ b/_azure-pipelines/template.yml @@ -0,0 +1,46 @@ +jobs: +- job: ${{ parameters.name }} + pool: + vmImage: ${{ parameters.vmImage }} + strategy: + matrix: + Python27: + PYTHON_VERSION: '2.7' + Python34: + PYTHON_VERSION: '3.4' + Python35: + PYTHON_VERSION: '3.5' + Python36: + PYTHON_VERSION: '3.6' + Python37: + PYTHON_VERSION: '3.7' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + architecture: 'x64' + displayName: 'Install Python' + - script: | + make + pipenv install -e .[socks] --skip-lock + displayName: 'Set up' + + - ${{ if eq(parameters.name, 'Linux') }}: + - script: | + make test-readme + make ci + displayName: 'Test and CI' + - task: PublishTestResults@2 + displayName: 'Publish test results' + inputs: + testResultsFiles: 'report.xml' + testRunTitle: Python $(PYTHON_VERSION) + + - ${{ if eq(parameters.name, 'Windows') }}: + - script: | + make coverage + displayName: 'Coverage' + + - script: | + pipenv run codecov -f coverage.xml + displayName: 'Run codecov' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 68eeedde..b8e7e0d0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,10 @@ jobs: -- template: _azure-pipelines/template-linux.yml +- template: _azure-pipelines/template.yml + parameters: + name: Linux + vmImage: Ubuntu-16.04 -- template: _azure-pipelines/template-windows.yml +- template: _azure-pipelines/template.yml + parameters: + name: Windows + vmImage: vs2017-win2016 \ No newline at end of file