Skip to content

Commit

Permalink
Fix azure syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
  • Loading branch information
techalchemy committed Mar 31, 2020
1 parent ffb78f5 commit 32cb35b
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 70 deletions.
82 changes: 31 additions & 51 deletions .azure-pipelines/steps/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,34 @@
parameters:
pythonVersions: []
vmImage: ''
jobName: ''
pythonArchitecture: ''

jobs:
- job: ${{ parameters.jobName }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
${{ each py in parameters.pythonVersions }}:
python.version: ${{ py }}
python.architecture: ${{ parameters.pythonArchitecture }}
maxParallel: 8

variables:
- group: CI

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: '$(python.architecture)'
addToPath: true
displayName: Use Python $(python.version)

- template: install-dependencies.yml

- script: |
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
env:
PYTHON_VERSION: $(python.version)
- template: create-virtualenv.yml
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: '$(python.architecture)'
addToPath: true
displayName: Use Python $(python.version)

- template: install-dependencies.yml

- script: |
echo '##vso[task.setvariable variable=PIPENV_DEFAULT_PYTHON_VERSION]'$(python.version)
env:
PYTHON_VERSION: $(python.version)

- template: create-virtualenv.yml
parameters:
python_version: $(python.version)

- ${{ if eq(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-windows.yml
parameters:
python_version: $(python.version)
- ${{ if ne(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-linux.yml
parameters:
python_version: $(python.version)

- ${{ if eq(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-windows.yml
parameters:
python_version: $(python.version)
- ${{ if ne(parameters.vmImage, 'windows-latest') }}:
- template: run-tests-linux.yml
parameters:
python_version: $(python.version)

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
86 changes: 67 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ trigger:
- master
paths:
exclude:
- docs/
- news/
- peeps/
- examples/
- docs/*
- news/*
- peeps/*
- examples/*
- pytest.ini
- README.md
- pipenv/*.txt
Expand All @@ -24,12 +24,28 @@ variables:
- group: CI

jobs:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
jobName: TestLinux
- job: TestLinux
pool:
vmImage: 'Ubuntu-latest'
pythonVersions: ["3.8", "3.7", "3.6", "3.5", "2.7"]
pythonArchitecture: x64
strategy:
matrix:
Python27:
python.version: '2.7'
python.architecture: x64
Python36:
python.version: '3.6'
python.architecture: x64
Python37:
python.version: '3.7'
python.architecture: x64
Python38:
python.version: '3.8'
python.architecture: x64
maxParallel: 8
steps:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: 'Ubuntu-latest'

- job: TestVendoring
pool:
Expand All @@ -53,16 +69,48 @@ jobs:
parameters:
vmImage: 'Ubuntu-latest'

- template: .azure-pipelines/steps/run-tests.yml
parameters:
jobName: TestWindows
- job: TestWindows
pool:
vmImage: windows-latest
pythonVersions: ["3.8", "3.7", "3.6", "3.5", "2.7"]
pythonArchitecture: x64
strategy:
matrix:
Python27:
python.version: '2.7'
python.architecture: x64
Python36:
python.version: '3.6'
python.architecture: x64
Python37:
python.version: '3.7'
python.architecture: x64
Python38:
python.version: '3.8'
python.architecture: x64
maxParallel: 8
steps:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: windows-latest

- template: .azure-pipelines/steps/run-tests.yml
parameters:
jobName: TestMacOS
- job: TestMacOS
pool:
vmImage: macOS-latest
pythonVersions: ["3.8", "3.7", "3.6", "3.5", "2.7"]
pythonArchitecture: x64
strategy:
matrix:
Python27:
python.version: '2.7'
python.architecture: x64
Python36:
python.version: '3.6'
python.architecture: x64
Python37:
python.version: '3.7'
python.architecture: x64
Python38:
python.version: '3.8'
python.architecture: x64
maxParallel: 8
steps:
- template: .azure-pipelines/steps/run-tests.yml
parameters:
vmImage: macOS-latest

0 comments on commit 32cb35b

Please sign in to comment.