azure-pipelines.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Python Django
  2. # Test a Django project on multiple versions of Python.
  3. # Add steps that analyze code, save build artifacts, deploy, and more:
  4. # https://docs.microsoft.com/azure/devops/pipelines/languages/python
  5. # NTOES:
  6. #
  7. # Display name of each step should be prefixed with one of the following:
  8. # CR-QC: for quality control measures.
  9. # CR-BUILD: for build-related tasks.
  10. # CR-DEPLOY: for publication or deployment.
  11. # [no prefix]: for unrelated CI setup/tooling.
  12. #
  13. # Use PowerShell Core for any scripts so they are re-usable across windows/mac/linux.
  14. #
  15. trigger:
  16. - master
  17. pool:
  18. vmImage: 'ubuntu-latest'
  19. strategy:
  20. matrix:
  21. py3.5:
  22. PYTHON_VERSION: '3.5'
  23. py3.6:
  24. PYTHON_VERSION: '3.6'
  25. py3.7:
  26. PYTHON_VERSION: '3.7'
  27. steps:
  28. - task: UsePythonVersion@0
  29. displayName: 'Use Python version'
  30. inputs:
  31. versionSpec: '$(PYTHON_VERSION)'
  32. architecture: 'x64'
  33. - script: |
  34. python -m pip install -e ./[ci]
  35. displayName: 'CR-QC: Install coderedcms from local repo'
  36. - script: |
  37. python -m pip freeze
  38. displayName: 'CR-QC: Show installed pip packages'
  39. - script: |
  40. coderedcms start testproject --name="Test Project" --domain="www.example.com"
  41. displayName: 'CR-QC: Create starter project from template'
  42. - script: |
  43. pytest coderedcms/ --ds=coderedcms.tests.settings --junitxml=junit/test-results.xml --cov=coderedcms --cov-report=xml --cov-report=html
  44. displayName: 'CR-QC: Run unit tests'
  45. - pwsh: |
  46. & ci/run_flake8.ps1
  47. displayName: 'CR-QC: Static analysis'
  48. - task: PublishTestResults@2
  49. displayName: 'Publish unit test report'
  50. condition: succeededOrFailed()
  51. inputs:
  52. testResultsFiles: '**/test-*.xml'
  53. testRunTitle: 'Publish test results for Python $(python.version)'
  54. - task: PublishCodeCoverageResults@1
  55. displayName: 'Publish code coverage report'
  56. condition: succeededOrFailed()
  57. inputs:
  58. codeCoverageTool: Cobertura
  59. summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'