From e91da8529210debd5f5ea45a3453a1a753a20e3b Mon Sep 17 00:00:00 2001 From: pengwangit <63082321+pengwangit@users.noreply.github.com> Date: Tue, 17 Nov 2020 11:12:45 +1100 Subject: [PATCH 1/4] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..7d405f9ee --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,36 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' +strategy: + matrix: + Python27: + python.version: '2.7' + Python35: + python.version: '3.5' + Python36: + python.version: '3.6' + Python37: + python.version: '3.7' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' + +- script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' From 79881fc826d4d2dd64e46620194087805e884e41 Mon Sep 17 00:00:00 2001 From: pengwangit <63082321+pengwangit@users.noreply.github.com> Date: Tue, 17 Nov 2020 11:18:53 +1100 Subject: [PATCH 2/4] Add Status badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bc29ab4b3..a9aa50c69 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://dev.azure.com/clouddevops0105/python-app/_apis/build/status/pengwangit.python-sample-vscode-flask-tutorial?branchName=master)](https://dev.azure.com/clouddevops0105/python-app/_build/latest?definitionId=1&branchName=master) + # Python/Flask Tutorial for Visual Studio Code * This sample contains the completed program from the tutorial, make sure to visit the link: [Using Flask in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-flask). Intermediate steps are not included. From de6d932eba71ad8dfdd6c488701840481c5a484c Mon Sep 17 00:00:00 2001 From: pengwangit <63082321+pengwangit@users.noreply.github.com> Date: Tue, 17 Nov 2020 13:26:05 +1100 Subject: [PATCH 3/4] Allow parallel builds --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7d405f9ee..3a359f430 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,6 +18,7 @@ strategy: python.version: '3.6' Python37: python.version: '3.7' + maxParallel: 2 steps: - task: UsePythonVersion@0 From b7bfb770710a643d7cf6f4e75c9befdebc1c3a8e Mon Sep 17 00:00:00 2001 From: pengwangit <63082321+pengwangit@users.noreply.github.com> Date: Tue, 17 Nov 2020 13:27:30 +1100 Subject: [PATCH 4/4] Fix space --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3a359f430..4b359ace1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,7 +18,7 @@ strategy: python.version: '3.6' Python37: python.version: '3.7' - maxParallel: 2 + maxParallel: 2 steps: - task: UsePythonVersion@0