|
@@ -0,0 +1,65 @@
|
|
|
+# Python Django
|
|
|
+# Test a Django project on multiple versions of Python.
|
|
|
+# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
|
+# https://docs.microsoft.com/azure/devops/pipelines/languages/python
|
|
|
+
|
|
|
+# NTOES:
|
|
|
+#
|
|
|
+# Display name of each step should be prefixed with one of the following:
|
|
|
+# CR-QC: for quality control measures.
|
|
|
+# CR-BUILD: for build-related tasks.
|
|
|
+# CR-DEPLOY: for publication or deployment.
|
|
|
+# [no prefix]: for unrelated CI setup/tooling.
|
|
|
+#
|
|
|
+# Use PowerShell Core for any scripts so they are re-usable across windows/mac/linux.
|
|
|
+#
|
|
|
+
|
|
|
+trigger:
|
|
|
+ - master
|
|
|
+
|
|
|
+pool:
|
|
|
+ vmImage: 'ubuntu-latest'
|
|
|
+strategy:
|
|
|
+ matrix:
|
|
|
+ py3.5:
|
|
|
+ PYTHON_VERSION: '3.5'
|
|
|
+ py3.6:
|
|
|
+ PYTHON_VERSION: '3.6'
|
|
|
+ py3.7:
|
|
|
+ PYTHON_VERSION: '3.7'
|
|
|
+
|
|
|
+steps:
|
|
|
+- task: UsePythonVersion@0
|
|
|
+ displayName: 'Use Python version'
|
|
|
+ inputs:
|
|
|
+ versionSpec: '$(PYTHON_VERSION)'
|
|
|
+ architecture: 'x64'
|
|
|
+
|
|
|
+- script: |
|
|
|
+ python -m pip install -e ./[ci]
|
|
|
+ displayName: 'CR-QC: Install coderedcms from local repo'
|
|
|
+
|
|
|
+- script: |
|
|
|
+ coderedcms start testproject --name="Test Project" --domain="www.example.com"
|
|
|
+ displayName: 'CR-QC: Create starter project from template'
|
|
|
+
|
|
|
+- script: |
|
|
|
+ pytest coderedcms/ --ds=coderedcms.tests.settings --junitxml=junit/test-results.xml --cov=coderedcms --cov-report=xml --cov-report=html
|
|
|
+ displayName: 'CR-QC: Run unit tests'
|
|
|
+
|
|
|
+- pwsh: |
|
|
|
+ & ci/run_flake8.ps1
|
|
|
+ displayName: 'CR-QC: Static analysis'
|
|
|
+
|
|
|
+- task: PublishTestResults@2
|
|
|
+ displayName: 'Publish unit test report'
|
|
|
+ condition: succeededOrFailed()
|
|
|
+ inputs:
|
|
|
+ testResultsFiles: '**/test-*.xml'
|
|
|
+ testRunTitle: 'Publish test results for Python $(python.version)'
|
|
|
+
|
|
|
+- task: PublishCodeCoverageResults@1
|
|
|
+ displayName: 'Publish code coverage report'
|
|
|
+ inputs:
|
|
|
+ codeCoverageTool: Cobertura
|
|
|
+ summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
|