Skip to content

Commit 52c0010

Browse files
committed
ci: condition passing init job to continue
1 parent 8334f34 commit 52c0010

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.azure/ipynb-publish.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,19 @@ jobs:
5959
git status
6060
git commit -m "prune: $(COMMIT_HASH)"
6161
condition: gt(variables['dropped.folders'], 0)
62-
displayName: "Prune notebook"
62+
displayName: "Prune notebooks"
6363
timeoutInMinutes: "10"
6464
6565
- bash: |
6666
set -ex
6767
git status
6868
git push https://$(PAT_GHOST)@github.com/Lightning-AI/tutorials.git $(PUB_BRANCH)
69-
displayName: "Finish push"
69+
displayName: "Finish and push"
7070
7171
- job: papermill
7272
dependsOn: sync_pub
73+
# run if the initial job succeeded and the strategy matrix is not empty
74+
condition: and(succeeded(), ne(dependencies.sync_pub.outputs['mtrx.dirs'], ''))
7375
strategy:
7476
# generated matrix with changed notebooks, include fields: "notebook", "agent-pool" and "docker-image"
7577
matrix: $[ dependencies.sync_pub.outputs['mtrx.dirs'] ]
@@ -97,8 +99,6 @@ jobs:
9799
COMMIT_HASH: "$(Build.SourceVersion)"
98100
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
99101

100-
condition: ne(dependencies.sync_pub.outputs['mtrx.dirs'], '')
101-
102102
steps:
103103
- bash: |
104104
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"
@@ -172,4 +172,4 @@ jobs:
172172
git status
173173
git show-ref $(PUB_BRANCH)
174174
git push https://$(PAT_GHOST)@github.com/Lightning-AI/tutorials.git $(PUB_BRANCH)
175-
displayName: "Finish push"
175+
displayName: "Finish and push"

.azure/ipynb-validate.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
vmImage: "Ubuntu-20.04"
1515
steps:
1616
- bash: |
17+
set -ex
1718
pip install -r .actions/requires.txt
1819
pip list
1920
displayName: "Install dependencies"
@@ -40,6 +41,8 @@ jobs:
4041

4142
- job: ipython
4243
dependsOn: check_diff
44+
# run if the initial job succeeded and the strategy matrix is not empty
45+
condition: and(succeeded(), ne(dependencies.check_diff.outputs['mtrx.dirs'], ''))
4346
strategy:
4447
matrix: $[ dependencies.check_diff.outputs['mtrx.dirs'] ]
4548
# how long to run the job before automatically cancelling
@@ -58,8 +61,6 @@ jobs:
5861
PATH_DATASETS: "$(Build.Repository.LocalPath)/.datasets"
5962
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
6063

61-
condition: ne(dependencies.check_diff.outputs['mtrx.dirs'], '')
62-
6364
steps:
6465
- bash: |
6566
echo "##vso[task.setvariable variable=CUDA_VISIBLE_DEVICES]$(DEVICES)"

0 commit comments

Comments
 (0)