1
0

azure-pipelines.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. trigger:
  2. - develop
  3. variables:
  4. python: '["py2.7", "py3.4", "py3.5", "py3.6", "py3.7", "py3.8"]'
  5. salt: '["v2018.3", "v2019.2", "develop"]'
  6. backends: '["cherrypy", "tornado"]'
  7. jobs:
  8. - job: build_matrix
  9. pool:
  10. vmImage: 'Ubuntu-16.04'
  11. steps:
  12. - task: UsePythonVersion@0
  13. inputs:
  14. versionSpec: '3.7'
  15. architecture: x64
  16. - task: PythonScript@0
  17. name: matrix
  18. inputs:
  19. scriptSource: Inline
  20. script: |
  21. import json
  22. matrix = {}
  23. for pyver in $(python):
  24. for saltver in $(salt):
  25. for backend in $(backends):
  26. matrix['{0}-{1}-{2}'.format(pyver, backend, saltver)] = {
  27. 'python.version': pyver[2:],
  28. 'version': pyver.replace('.', ''),
  29. 'salt': saltver,
  30. 'backend': backend,
  31. }
  32. print('##vso[task.setvariable variable=matrix;isOutput=true]{0}'.format(json.dumps(matrix)))
  33. - job: test_pepper
  34. dependsOn: build_matrix
  35. pool:
  36. vmImage: 'Ubuntu-16.04'
  37. strategy:
  38. matrix: $[ dependencies.build_matrix.outputs['matrix.matrix'] ]
  39. steps:
  40. - task: UsePythonVersion@0
  41. inputs:
  42. versionSpec: '$(python.version)'
  43. architecture: x64
  44. - script: |
  45. pip install tox
  46. displayName: Install dependencies
  47. - script: |
  48. docker run -v $PWD:/pepper --rm "python:$(python.version)" make -C /pepper test PYTHON_VERSION=$(version) SALT=$(salt) BACKEND=$(backend)
  49. displayName: pytest
  50. - script: |
  51. sudo chown $USER .tox/
  52. tox -e codecov
  53. displayName: codecov
  54. env:
  55. CODECOV_TOKEN: '16c2a232-4329-438c-b163-ccbfeeab47aa'