Skip to content

Commit

Permalink
Merge pull request #2077 from jaimergp/short-circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Oct 3, 2024
2 parents 7ac0ac8 + 590a9b8 commit 5817e63
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 12 deletions.
50 changes: 38 additions & 12 deletions conda_smithy/templates/azure-pipelines.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
24 changes: 24 additions & 0 deletions news/2077-azure-skips.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**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:**

* <news item>

0 comments on commit 5817e63

Please sign in to comment.