| 1 |
parameters: |
| 2 |
name: '' # defaults for any parameters that aren't specified |
| 3 |
vmImage: '' |
| 4 |
pythonVersion: '' |
| 5 |
|
| 6 |
jobs: |
| 7 |
- job: ${{ parameters.name }} |
| 8 |
pool: |
| 9 |
vmImage: ${{ parameters.vmImage }} |
| 10 |
steps: |
| 11 |
- task: UsePythonVersion@0 |
| 12 |
inputs: |
| 13 |
versionSpec: ${{ parameters.pythonVersion }} |
| 14 |
addToPath: true |
| 15 |
architecture: x64 |
| 16 |
- template: prepare-env.yml |
| 17 |
- script: | |
| 18 |
coverage run -m pytest --junitxml=junit/test-results.xml tests && coverage xml |
| 19 |
displayName: 'Test with pytest' |
| 20 |
- bash: flake8 |
| 21 |
displayName: flake8 |
| 22 |
- task: PublishTestResults@2 |
| 23 |
condition: succeededOrFailed() |
| 24 |
inputs: |
| 25 |
testResultsFiles: 'junit/test-*.xml' |
| 26 |
testRunTitle: 'Publish test results for Python ${{ parameters.pythonVersion }}' |
| 27 |
- task: PublishCodeCoverageResults@2 |
| 28 |
inputs: |
| 29 |
codeCoverageTool: cobertura |
| 30 |
summaryFileLocation: coverage.xml |
| 31 |
- bash: | |
| 32 |
COVERALLS_REPO_TOKEN=$(CRT) coveralls |
| 33 |
displayName: 'Coveralls' |