azure-pipeline.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. resources:
  2. - repo: self
  3. trigger:
  4. batch: true
  5. branches:
  6. include:
  7. - '*'
  8. pr:
  9. branches:
  10. include:
  11. - '*'
  12. jobs:
  13. - job: TestInstall
  14. timeoutInMinutes: 10
  15. pool:
  16. vmImage: 'ubuntu-latest'
  17. strategy:
  18. matrix:
  19. Python37:
  20. python.version: '3.7'
  21. Python38:
  22. python.version: '3.8'
  23. Python310:
  24. python.version: '3.10'
  25. steps:
  26. - task: UsePythonVersion@0
  27. displayName: 'Use Python $(python.version)'
  28. inputs:
  29. versionSpec: '$(python.version)'
  30. - bash: |
  31. set -ev
  32. pip install -e .
  33. displayName: Install from Source
  34. - job: BuildPythonWheel
  35. condition: succeeded()
  36. pool:
  37. vmImage: 'ubuntu-latest'
  38. steps:
  39. - task: UsePythonVersion@0
  40. displayName: Use Python 3.7
  41. inputs:
  42. versionSpec: 3.7
  43. - bash: |
  44. set -ev
  45. : "${BUILD_STAGINGDIRECTORY:?BUILD_STAGINGDIRECTORY environment variable not set}"
  46. echo "Build knack"
  47. pip install -U pip setuptools wheel
  48. python setup.py bdist_wheel -d "${BUILD_STAGINGDIRECTORY}"
  49. python setup.py sdist -d "${BUILD_STAGINGDIRECTORY}"
  50. displayName: Build Wheel
  51. - task: PublishPipelineArtifact@0
  52. displayName: 'Publish Artifact: pypi'
  53. inputs:
  54. TargetPath: $(Build.ArtifactStagingDirectory)
  55. ArtifactName: pypi
  56. - task: DownloadPipelineArtifact@1
  57. displayName: 'Download PyPI Packages'
  58. inputs:
  59. TargetPath: '$(Build.ArtifactStagingDirectory)/pypi'
  60. artifactName: pypi
  61. - bash: |
  62. set -ev
  63. cd $BUILD_ARTIFACTSTAGINGDIRECTORY/pypi
  64. pwd
  65. ls -la
  66. displayName: Test Build Wheel