diff --git a/conda_smithy/templates/azure-pipelines.yml.tmpl b/conda_smithy/templates/azure-pipelines.yml.tmpl index 5da1ef821..0d60d89f6 100644 --- a/conda_smithy/templates/azure-pipelines.yml.tmpl +++ b/conda_smithy/templates/azure-pipelines.yml.tmpl @@ -10,15 +10,41 @@ {%- endif %} {%- endfor %} -jobs: - {%- for platform in platformset %} - {%- if platform == 'win' %} - - template: ./.azure-pipelines/azure-pipelines-win.yml - {%- endif %} - {%- if platform == 'osx' %} - - template: ./.azure-pipelines/azure-pipelines-osx.yml - {%- endif %} - {%- if platform == 'linux' %} - - template: ./.azure-pipelines/azure-pipelines-linux.yml - {%- endif %} - {%- endfor %} +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-22.04' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + steps: + - checkout: self + {# We only need two: the PR merge commit, and the actual commit added by the user #} + fetchDepth: '2' + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` + echo "##vso[task.setvariable variable=log]$git_log" + displayName: Obtain commit message + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')) + displayName: Skip build? + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result + displayName: Export result +- stage: Build + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + {%- for platform in platformset %} + {%- if platform == 'win' %} + - template: ./.azure-pipelines/azure-pipelines-win.yml + {%- endif %} + {%- if platform == 'osx' %} + - template: ./.azure-pipelines/azure-pipelines-osx.yml + {%- endif %} + {%- if platform == 'linux' %} + - template: ./.azure-pipelines/azure-pipelines-linux.yml + {%- endif %} + {%- endfor %} diff --git a/news/2077-azure-skips.rst b/news/2077-azure-skips.rst new file mode 100644 index 000000000..a73b8e3a2 --- /dev/null +++ b/news/2077-azure-skips.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Azure Pipelines will now skip build jobs if the last commit message contains one of + ``[skip ci]``, ``[ci skip]``, ``[skip azp]``, or ``[azp skip]``. (#2077) + +**Security:** + +*