Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update YAML syntax for Azure Pipelines #3165

Merged
merged 6 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .azure-pipelines/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
jobs:
- job:
displayName: Docs
pool:
vmImage: ubuntu-16.04

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'

- template: steps/install-dependencies.yml

- bash: tox -e docs
displayName: Build docs

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: docs'
inputs:
pathToPublish: docs/build
artifactName: docs
14 changes: 14 additions & 0 deletions .azure-pipelines/jobs/run-manifest-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- bash: |
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install check-manifest
check-manifest
12 changes: 12 additions & 0 deletions .azure-pipelines/jobs/run-tests-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- template: ../steps/create-virtualenv.yml

- template: ../steps/run-tests.yml
37 changes: 37 additions & 0 deletions .azure-pipelines/jobs/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- bash: |
mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs"
mkdir -p "$WORKON_HOME"
pip install certifi
export GIT_SSL_CAINFO="$(python -m certifi)"
export LANG="C.UTF-8"
export PIP_PROCESS_DEPENDENCY_LINKS="1"
echo "Path $PATH"
echo "Installing Pipenv…"
pip install -e "$(pwd)" --upgrade
pipenv install --deploy --dev
echo pipenv --venv && echo pipenv --py && echo pipenv run python --version
displayName: Make Virtualenv

- script: |
# Fix Git SSL errors
export GIT_SSL_CAINFO="$(python -m certifi)"
export LANG="C.UTF-8"
export PIP_PROCESS_DEPENDENCY_LINKS="1"
pipenv run pytest --junitxml=test-results.xml
displayName: Run integration tests

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
39 changes: 39 additions & 0 deletions .azure-pipelines/jobs/run-vendor-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
parameters:
vmImage:

jobs:
- job: Vendor_Scripts
displayName: Test Vendor Scripts
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4
matrix:
${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
# TODO remove once vs2017-win2016 has Python 3.7
Python37:
python.version: '>= 3.7.0-b2'
python.architecture: x64
${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}:
Python37:
python.version: '>= 3.7'
python.architecture: x64
steps:
- task: UsePythonVersion@0
displayName: Use Python $(python.version)
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'

- template: ../steps/install-dependencies.yml

- bash: |
mkdir -p "$AGENT_HOMEDIRECTORY/.virtualenvs"
mkdir -p "$WORKON_HOME"
pip install certifi
export GIT_SSL_CAINFO=$(python -m certifi)
export LANG=C.UTF-8
python -m pip install --upgrade invoke requests parver
python -m invoke vendoring.update

- template: ./run-manifest-check.yml
48 changes: 48 additions & 0 deletions .azure-pipelines/jobs/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
parameters:
vmImage:

jobs:
- job: Test_Primary
displayName: Test Primary
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4
matrix:
Python27:
python.version: '2.7'
python.architecture: x64
${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
# TODO remove once vs2017-win2016 has Python 3.7
Python37:
python.version: '>= 3.7.0-b2'
python.architecture: x64
${{ if ne(parameters.vmImage, 'vs2017-win2016' )}}:
Python37:
python.version: '>= 3.7'
python.architecture: x64
steps:
- ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests-windows.yml

- ${{ if ne(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests.yml

- job: Test_Secondary
displayName: Test python3.6
# Run after Test_Primary so we don't devour time and jobs if tests are going to fail
# dependsOn: Test_Primary
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
maxParallel: 4
matrix:
Python36:
python.version: '3.6'
python.architecture: x64
steps:
- ${{ if eq(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests-windows.yml

- ${{ if ne(parameters.vmImage, 'vs2017-win2016') }}:
- template: ./run-tests.yml
27 changes: 27 additions & 0 deletions .azure-pipelines/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pipenv Build Rules
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- news/*
- README.md
- pipenv/*.txt
- CHANGELOG.rst
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- .gitignore
- .gitattributes
- .editorconfig

jobs:
- template: jobs/test.yml
parameters:
vmImage: ubuntu-16.04

- template: jobs/run-vendor-scripts.yml
parameters:
vmImage: ubuntu-16.04
6 changes: 6 additions & 0 deletions .azure-pipelines/steps/create-virtualenv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:
- script: |
virtualenv D:\.venv
D:\.venv\Scripts\pip.exe install -e . && D:\.venv\Scripts\pipenv install --dev
echo D:\.venv\Scripts\pipenv --venv && echo D:\.venv\Scripts\pipenv --py && echo D:\.venv\Scripts\pipenv run python --version
displayName: Make Virtualenv
3 changes: 3 additions & 0 deletions .azure-pipelines/steps/install-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
steps:
- script: 'python -m pip install --upgrade pip && python -m pip install -e .'
displayName: Upgrade Pip & Install Pipenv
23 changes: 23 additions & 0 deletions .azure-pipelines/steps/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
steps:
- powershell: |
# Fix Git SSL errors
pip install certifi
python -m certifi > cacert.txt
Write-Host "##vso[task.setvariable variable=GIT_SSL_CAINFO]$(Get-Content cacert.txt)"
$env:GIT_SSL_CAINFO="$(Get-Content cacert.txt)"
# Shorten paths to get under MAX_PATH or else integration tests will fail
# https://bugs.python.org/issue18199
subst T: "$env:TEMP"
Write-Host "##vso[task.setvariable variable=TEMP]T:\"
$env:TEMP='T:\'
Write-Host "##vso[task.setvariable variable=TMP]T:\"
$env:TEMP='T:\'
D:\.venv\Scripts\pipenv run pytest -ra --ignore=pipenv\patched --ignore=pipenv\vendor --junitxml=test-results.xml tests
displayName: Run integration tests

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
23 changes: 23 additions & 0 deletions .azure-pipelines/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pipenv Build Rules
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- news/*
- README.md
- pipenv/*.txt
- CHANGELOG.rst
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- .gitignore
- .gitattributes
- .editorconfig

jobs:
- template: jobs/test.yml
parameters:
vmImage: vs2017-win2016
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ recursive-exclude pipenv *.pyi
recursive-exclude pipenv *.typed

prune peeps
prune .azure-pipelines
prune .buildkite
prune .github
prune .vsts-ci
Expand Down
1 change: 1 addition & 0 deletions news/3164.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Azure Pipelines YAML files are updated to use the latest syntax and product name.