8000 CI make it possible to cancel running Azure jobs (#25876) · jeremiedbb/scikit-learn@1a9257c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a9257c

Browse files
authored
CI make it possible to cancel running Azure jobs (scikit-learn#25876)
1 parent 392fdee commit 1a9257c

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ jobs:
169169
name: Linux
170170
vmImage: ubuntu-20.04
171171
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
172+
# Runs when dependencies succeeded or skipped
172173
condition: |
173174
and(
174-
in(dependencies['Ubuntu_Jammy_Jellyfish']['result'], 'Succeeded', 'Skipped'),
175+
not(or(failed(), canceled())),
175176
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
176177
)
177178
matrix:
@@ -204,9 +205,10 @@ jobs:
204205
name: Linux_Docker
205206
vmImage: ubuntu-20.04
206207
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
208+
# Runs when dependencies succeeded or skipped
207209
condition: |
208210
and(
209-
in(dependencies['Ubuntu_Jammy_Jellyfish']['result'], 'Succeeded', 'Skipped'),
211+
not(or(failed(), canceled())),
210212
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
211213
)
212214
matrix:
@@ -223,9 +225,10 @@ jobs:
223225
name: macOS
224226
vmImage: macOS-11
225227
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
228+
# Runs when dependencies succeeded or skipped
226229
condition: |
227230
and(
228-
in(dependencies['Ubuntu_Jammy_Jellyfish']['result'], 'Succeeded', 'Skipped'),
231+
not(or(failed(), canceled())),
229232
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
230233
)
231234
matrix:
@@ -245,9 +248,10 @@ jobs:
245248
name: Windows
246249
vmImage: windows-latest
247250
dependsOn: [linting, git_commit, Ubuntu_Jammy_Jellyfish]
251+
# Runs when dependencies succeeded or skipped
248252
condition: |
249253
and(
250-
in(dependencies['Ubuntu_Jammy_Jellyfish']['result'], 'Succeeded', 'Skipped'),
254+
not(or(failed(), canceled())),
251255
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]'))
252256
)
253257
matrix:

build_tools/azure/posix.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ jobs:
6363
- script: |
6464
build_tools/azure/test_docs.sh
6565
displayName: 'Test Docs'
66-
condition: eq(variables['SELECTED_TESTS'], '')
66+
condition: and(succeeded(), eq(variables['SELECTED_TESTS'], ''))
6767
- script: |
6868
build_tools/azure/test_pytest_soft_dependency.sh
6969
displayName: 'Test Soft Dependency'
70-
condition: and(eq(variables['CHECK_PYTEST_SOFT_DEPENDENCY'], 'true'),
70+
condition: and(succeeded(),
71+
eq(variables['CHECK_PYTEST_SOFT_DEPENDENCY'], 'true'),
7172
eq(variables['SELECTED_TESTS'], ''))
7273
- task: PublishTestResults@2
7374
inputs:

build_tools/azure/windows.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,14 @@ jobs:
3737
addToPath: true
3838
architecture: 'x86'
3939
displayName: Use 32 bit System Python
40-
condition: eq(variables['PYTHON_ARCH'], '32')
40+
condition: and(succeeded(), eq(variables['PYTHON_ARCH'], '32'))
4141
- bash: ./build_tools/azure/install_win.sh
4242
displayName: 'Install'
4343
- bash: ./build_tools/azure/test_script.sh
4444
displayName: 'Test Library'
4545
- bash: ./build_tools/azure/upload_codecov.sh
46-
condition: and(succeeded(), eq(variables['COVERAGE'], 'true'),
46+
condition: and(succeeded(),
47+
eq(variables['COVERAGE'], 'true'),
4748
eq(variables['SELECTED_TESTS'], ''))
4849
displayName: 'Upload To Codecov'
4950
env:

0 commit comments

Comments
 (0)
0