azure-pipelines.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. variables:
  40. myVar: $[ dependencies.build_matrix.outputs['matrix.matrix'] ]
  41. steps:
  42. - script: echo $(myVar)
  43. - task: UsePythonVersion@0
  44. inputs:
  45. versionSpec: '$(python.version)'
  46. architecture: x64
  47. - script: |
  48. pip install tox
  49. displayName: Install dependencies
  50. - script: |
  51. docker run -v $PWD:/pepper --rm "python:$(python.version)" make -C /pepper test PYTHON_VERSION=$(version) SALT=$(salt) BACKEND=$(backend)
  52. displayName: pytest
  53. - script: |
  54. sudo chown $USER .tox/
  55. tox -e codecov
  56. displayName: codecov
  57. env:
  58. CODECOV_TOKEN: '16c2a232-4329-438c-b163-ccbfeeab47aa'