Pillow/.azure-pipelines/jobs/test.yml

50 lines
1.2 KiB
YAML

parameters:
name: '' # defaults for any parameters that aren't specified
vmImage: ''
jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: |
python -m pip install --upgrade pip
python -m pip install --upgrade freezegun pytest pytest-cov requests_mock
python -m pip install -e .
displayName: 'Install dependencies'
- script: |
pytest --cov pypistats --junitxml=junit/test-results.xml
displayName: 'Unit tests'
- script: |
pypistats --help
pypistats recent --help
displayName: 'Test runs'
- script: |
python -m pip install --upgrade codecov
codecov --name "Python $(python.version)" --build $(Build.BuildNumber)
condition: succeeded()
displayName: 'Upload to Codecov'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()