From 221a6496908396460364e72cd167d19df01c29be Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Fri, 20 Sep 2019 19:47:35 -0700 Subject: CI: minor refactoring * Rename some tasks * Simplify python commands by removing python3 -m * Break up some long lines --- azure-pipelines.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f0b44db5..64e26661 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,10 +16,13 @@ jobs: versionSpec: '3.7.x' addToPath: true - - script: python3 -m pip install pipenv && pipenv install --dev --system && python3 -m pip install flake8-formatter-junit-xml + - script: | + pip install pipenv + pipenv install --dev --system + pip install flake8-formatter-junit-xml displayName: 'Install Project Environment' - - script: python3 -m flake8 --format junit-xml --output-file TEST-lint.xml + - script: flake8 --format junit-xml --output-file TEST-lint.xml displayName: 'Run Linter' - script: | @@ -38,22 +41,27 @@ jobs: displayName: 'Setup Database' - script: | - python manage.py makemigrations --check - python manage.py migrate - coverage run --branch manage.py test --testrunner xmlrunner.extra.djangotestrunner.XMLTestRunner --no-input + python3 manage.py makemigrations --check + python3 manage.py migrate + coverage run \ + --branch \ + manage.py test \ + --testrunner xmlrunner.extra.djangotestrunner.XMLTestRunner \ + --no-input env: CI: azure DATABASE_URL: postgres://pysite:pysite@localhost/pysite - displayName: 'Run Test' + displayName: 'Run Tests' - script: coverage report displayName: 'Show Coverage Results' - task: PublishTestResults@2 condition: succeededOrFailed() + displayName: 'Publish Test & Linting Results' inputs: - testResultsFiles: "**/TEST-*.xml" - testRunTitle: 'Site-Django Test Results' + testResultsFiles: '**/TEST-*.xml' + testRunTitle: 'Site Test Results' - job: build displayName: 'Build & Push Container' @@ -63,7 +71,6 @@ jobs: steps: - task: Docker@2 displayName: 'Build & Push Container' - inputs: containerRegistry: 'DockerHubV2' repository: 'pythondiscord/site' -- cgit v1.2.3