From 30b0f12a8dac8c02cbf8b6154fc43b24078edf28 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Mon, 4 Dec 2023 11:34:17 +0000 Subject: [PATCH 1/2] Allow cancelling jobs --- .azure/azure-ci-build-pipeline.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index 26559889..fe1cc58e 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -44,10 +44,11 @@ stages: jobs: - ${{ each item in parameters.matrix }}: - job: ${{ item.job_name }} + timeoutInMinutes: 90 + cancelTimeoutInMinutes: 1 pool: vmImage: ${{ item.img }} - - condition: or( eq(variables['Build.Reason'], 'PullRequest'), ${{ item.every_time }} ) + condition: and(succeeded(), or( eq(variables['Build.Reason'], 'PullRequest'), ${{ item.every_time }} )) steps: - task: UsePythonVersion@0 From 385a4997ce289afdc27e8ae318d7db9fa0e851c3 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Thu, 7 Dec 2023 10:35:50 +0000 Subject: [PATCH 2/2] New parameter for publishing code coverage --- .azure/azure-ci-build-pipeline.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.azure/azure-ci-build-pipeline.yaml b/.azure/azure-ci-build-pipeline.yaml index fe1cc58e..f962a628 100644 --- a/.azure/azure-ci-build-pipeline.yaml +++ b/.azure/azure-ci-build-pipeline.yaml @@ -18,26 +18,32 @@ parameters: py: '3.8' img: 'ubuntu-latest' every_time: false + publish_coverage: false - job_name: 'UbuntuPython310' py: '3.10' img: 'ubuntu-latest' every_time: true + publish_coverage: true - job_name: 'WindowsPython38' py: '3.8' img: 'windows-latest' every_time: false + publish_coverage: false - job_name: 'WindowsPython310' py: '3.10' img: 'windows-latest' every_time: false + publish_coverage: false - job_name: 'MacOSPython38' py: '3.8' img: 'macOS-latest' every_time: false + publish_coverage: false - job_name: 'MacOSPython310' py: '3.10' img: 'macOS-latest' every_time: false + publish_coverage: false stages: - stage: Test @@ -110,12 +116,12 @@ stages: - publish: $(System.DefaultWorkingDirectory)/htmlcov/ # publish the html report - so we can debug the coverage if needed - condition: ${{ item.every_time }} # should only be run once + condition: ${{ item.publish_coverage }} # should only be run once artifact: coverage_report - task: PublishCodeCoverageResults@2 # publish the code coverage so it can be viewed in the run coverage page - condition: ${{ item.every_time }} # should only be run once + condition: ${{ item.publish_coverage }} # should only be run once inputs: codeCoverageTool: Cobertura summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'