Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (51 sloc) 1.83 KB
# 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
schedules:
- cron: '30 17 * * *' # cron syntax defining a schedule
displayName: 'string' # friendly name given to a specific schedule
branches:
include: [ 'master' ] # which branches the schedule applies to
exclude: [ ] # which branches to exclude from the schedule
always: 'true' # whether to always run the pipeline or only if there have been source code changes since the last run. The default is false.
strategy:
matrix:
LPython37:
python.version: '3.7'
vmImage: 'ubuntu-latest'
WPython37:
python.version: '3.7'
vmImage: 'vs2017-win2016'
LPython36:
python.version: '3.6'
vmImage: 'ubuntu-latest'
WPython36:
python.version: '3.6'
vmImage: 'vs2017-win2016'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: |
pip install -r requirements-dev.txt
flake8
pytest --junitxml=junit/test-results.xml --cov=src --cov-report=xml --cov-report=html
displayName: 'pytest'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
You can’t perform that action at this time.