Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
whitespaces, comments and CG condition
  • Loading branch information
KarishmaGhiya committed Feb 13, 2019
commit 8c610a91678442e2ba06095f50b79cd085b52bb9
188 changes: 164 additions & 24 deletions .azure-pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@
# 'build_targeting_string' comma separated glob strings selecting the packages that should be built. EG: "azure-keyvault,azure-mgmt-batch" or "azure-*"
# 'codecov-python-repository-token' Is the codecov.io repository token.
# 'long_running_tests' Is a boolean indicating that the long-running tests should be executed.
# 'EnableDetectorPip': true . Required for Component Governance Support

trigger:
- master

variables:
PythonVersion: '3.6'

jobs:
- job: 'Build_Target_Packages'

pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-16.04'

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
displayName: 'Use Python $(PythonVersion)'
inputs:
versionSpec: 3.6
versionSpec: $(PythonVersion)

- script: |
pip install wheel setuptools pathlib twine readme-renderer[md]
displayName: 'Prep Environment'
displayName: 'Prep Environment'

- task: PythonScript@0
displayName: 'Generate Packages'
inputs:
Expand All @@ -32,44 +34,182 @@ jobs:
- script: |
twine check $(Build.ArtifactStagingDirectory)/*
displayName: 'Verify Readme'

- task: CopyFiles@2
displayName: 'Move Dependencies Report to Build Artifacts'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: dependencies.html
TargetFolder: '$(Build.ArtifactStagingDirectory)'
condition: always()

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
condition: succeededOrFailed()

- job: 'Analyze'

dependsOn:
- 'Build_Target_Packages'

pool:
vmImage: 'vs2017-win2016'
vmImage: 'ubuntu-16.04'

steps:

- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
displayName: 'Use Python $(PythonVersion)'
inputs:
versionSpec: 3.6
versionSpec: '$(PythonVersion)'

- script: |
pip install wheel Jinja2
displayName: 'Prep Environment'

- task: PythonScript@0
displayName: 'Analyze dependencies'
enabled: true
inputs:
scriptPath: 'scripts/analyze_deps.py'
arguments: '--verbose --out "$(Build.SourcesDirectory)/dependencies.html"'
arguments: '--verbose --out "$(Build.ArtifactStagingDirectory)/dependencies.html"'

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
condition: and(always(), ne(variables['Build.Reason'], 'PullRequest'))
# ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
# builds should be sufficient.
condition: and(always(), ne(variables['Build.Reason'],'PullRequest'))
displayName: 'Component Detection'

- task: PublishBuildArtifacts@1
# To Publish artifacts generated by the 'Analyze dependencies' task under 'Analyze' job
displayName: 'Publish Artifacts'
condition: succeededOrFailed()

- job: 'Generic_Tests'

dependsOn:
- 'Build_Target_Packages'

strategy:
matrix:
Linux_Python27:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
python.version: '2.7'
Linux_Python34:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
python.version: '3.4'
Linux_Python35:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
python.version: '3.5'
Linux_Python36:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
python.version: '3.6'
Linux_Python37:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
python.version: '3.7'
Windows_Python35:
os.name: 'Windows'
os.vmImage: 'vs2017-win2016'
python.version: '3.5'
MacOS_Python27:
os.name: 'MacOS'
os.vmImage: 'macOS-10.13'
python.version: '2.7'

pool:
vmImage: '$(os.vmImage)'

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

- script: |
pip install pathlib twine codecov beautifulsoup4
displayName: 'Prep Environment'

- task: PythonScript@0
displayName: 'Setup and Run Tests'
inputs:
scriptPath: 'scripts/devops_tasks/setup_execute_tests.py'
arguments: '"$(build_targeting_string)"'

- script: |
coverage xml
coverage html
displayName: 'Generate Coverage XML'

- script: |
codecov -t $(codecov-python-repository-token)
displayName: 'Publish Code Cov'
condition: ne(variables['codecov-python-repository-token'], '')

- task: PythonScript@0
displayName: 'Inline CSS for Cobertura'
inputs:
scriptPath: 'scripts/devops_tasks/inline_css_for_cobertura.py'

- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage to DevOps'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/htmlcov'

- job: Test_Alpha_Python

timeoutInMinutes: 90
condition: eq(variables['long_running_tests'], True)
dependsOn:
- 'Build_Target_Packages'

pool:
vmImage: 'ubuntu-16.04'

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.7 For Build Tools'
inputs:
versionSpec: '3.7'

- script: |
sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev liblzma-dev libreadline-dev libncursesw5-dev libffi-dev uuid-dev
cd ~/
git clone https://github.com/python/cpython.git
cd cpython
mkdir debug
cd debug
../configure --enable-optimizations --prefix=$HOME
make install
cd $(Build.SourcesDirectory)
PATH=/home/vsts/bin:$PATH
python3 -m ensurepip
python ./scripts/devops_tasks/setup_execute_tests.py -p python3 "$(build_targeting_string)"
displayName: 'Setup - Run Filtered Tests "Nightly" Python'
continueOnError: true

- job: Test_PyPy

timeoutInMinutes: 90
condition: eq(variables['long_running_tests'], True)
dependsOn:
- 'Build_Target_Packages'

pool:
vmImage: 'ubuntu-16.04'

steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.7 For Build Tools'
inputs:
versionSpec: '3.7'

- script: |
pip install pathlib twine
displayName: 'Prep Environment'

- script: |
cd ~/
wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux64.tar.bz2
tar xf pypy3-v6.0.0-linux64.tar.bz2
cd $(Build.SourcesDirectory)
PATH=/home/vsts/pypy3-v6.0.0-linux64/bin/:$PATH
pypy3 -m ensurepip
python ./scripts/devops_tasks/setup_execute_tests.py -p pypy3 "$(build_targeting_string)"
displayName: 'Setup and Run Filtered Tests PyPy3'
continueOnError: true