azure-pipelines.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. coderedcms start testproject --name="Test Project" --domain="www.example.com"
  38. displayName: 'CR-QC: Create starter project from template'
  39. - script: |
  40. pytest coderedcms/ --ds=coderedcms.tests.settings --junitxml=junit/test-results.xml --cov=coderedcms --cov-report=xml --cov-report=html
  41. displayName: 'CR-QC: Run unit tests'
  42. - pwsh: |
  43. & ci/run_flake8.ps1
  44. displayName: 'CR-QC: Static analysis'
  45. - task: PublishTestResults@2
  46. displayName: 'Publish unit test report'
  47. condition: succeededOrFailed()
  48. inputs:
  49. testResultsFiles: '**/test-*.xml'
  50. testRunTitle: 'Publish test results for Python $(python.version)'
  51. - task: PublishCodeCoverageResults@1
  52. displayName: 'Publish code coverage report'
  53. condition: succeededOrFailed()
  54. inputs:
  55. codeCoverageTool: Cobertura
  56. summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'