File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ jobs:
178
178
upload-models :
179
179
needs : export-models
180
180
runs-on : linux.2xlarge
181
+ if : always() # Continue this job regardless of previous job outcome
181
182
steps :
182
183
- name : Download the models from GitHub
183
184
uses : actions/download-artifact@v3
@@ -186,14 +187,25 @@ jobs:
186
187
name : android-models
187
188
path : ${{ runner.temp }}/artifacts/
188
189
189
- - name : Verify the models
190
+ - name : Verify models
191
+ id : verify-models
190
192
shell : bash
191
193
working-directory : ${{ runner.temp }}/artifacts/
192
194
run : |
193
195
ls -lah ./
194
196
197
+ # Check if the directory contains any model
198
+ if [ -z "$(ls -A .)" ]; then
199
+ echo "No models found."
200
+ echo "::set-output name=models-found::false"
201
+ else
202
+ echo "Models found."
203
+ echo "::set-output name=models-found::true"
204
+ fi
205
+
195
206
- name : Upload the models to S3
196
207
uses : seemethere/upload-artifact-s3@v5
208
+ if : steps.verify-models.outputs.models-found == 'true' # Upload only if models were found
197
209
with :
198
210
s3-bucket : gha-artifacts
199
211
s3-prefix : |
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ jobs:
177
177
upload-models :
178
178
needs : export-models
179
179
runs-on : linux.2xlarge
180
+ if : always() # Continue this job regardless of previous job outcome
180
181
steps :
181
182
- name : Download the models from GitHub
182
183
uses : actions/download-artifact@v3
@@ -185,14 +186,25 @@ jobs:
185
186
name : ios-models
186
187
path : ${{ runner.temp }}/artifacts/
187
188
188
- - name : Verify the models
189
+ - name : Verify models
190
+ id : verify-models
189
191
shell : bash
190
192
working-directory : ${{ runner.temp }}/artifacts/
191
193
run : |
192
194
ls -lah ./
193
195
196
+ # Check if the directory contains any model
197
+ if [ -z "$(ls -A .)" ]; then
198
+ echo "No models found."
199
+ echo "::set-output name=models-found::false"
200
+ else
201
+ echo "Models found."
202
+ echo "::set-output name=models-found::true"
203
+ fi
204
+
194
205
- name : Upload the models to S3
195
206
uses : seemethere/upload-artifact-s3@v5
207
+ if : steps.verify-models.outputs.models-found == 'true' # Upload only if models were found
196
208
with :
197
209
s3-bucket : gha-artifacts
198
210
s3-prefix : |
You can’t perform that action at this time.
0 commit comments