Skip to content

Commit 08530bf

Browse files
author
Guang Yang
committed
Updated the workflow to upload models to S3
1 parent a4d67e2 commit 08530bf

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/android-perf.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ jobs:
178178
upload-models:
179179
needs: export-models
180180
runs-on: linux.2xlarge
181+
if: always() # Continue this job regardless of previous job outcome
181182
steps:
182183
- name: Download the models from GitHub
183184
uses: actions/download-artifact@v3
@@ -186,14 +187,25 @@ jobs:
186187
name: android-models
187188
path: ${{ runner.temp }}/artifacts/
188189

189-
- name: Verify the models
190+
- name: Verify models
191+
id: verify-models
190192
shell: bash
191193
working-directory: ${{ runner.temp }}/artifacts/
192194
run: |
193195
ls -lah ./
194196
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+
195206
- name: Upload the models to S3
196207
uses: seemethere/upload-artifact-s3@v5
208+
if: steps.verify-models.outputs.models-found == 'true' # Upload only if models were found
197209
with:
198210
s3-bucket: gha-artifacts
199211
s3-prefix: |

.github/workflows/apple-perf.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ jobs:
177177
upload-models:
178178
needs: export-models
179179
runs-on: linux.2xlarge
180+
if: always() # Continue this job regardless of previous job outcome
180181
steps:
181182
- name: Download the models from GitHub
182183
uses: actions/download-artifact@v3
@@ -185,14 +186,25 @@ jobs:
185186
name: ios-models
186187
path: ${{ runner.temp }}/artifacts/
187188

188-
- name: Verify the models
189+
- name: Verify models
190+
id: verify-models
189191
shell: bash
190192
working-directory: ${{ runner.temp }}/artifacts/
191193
run: |
192194
ls -lah ./
193195
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+
194205
- name: Upload the models to S3
195206
uses: seemethere/upload-artifact-s3@v5
207+
if: steps.verify-models.outputs.models-found == 'true' # Upload only if models were found
196208
with:
197209
s3-bucket: gha-artifacts
198210
s3-prefix: |

0 commit comments

Comments
 (0)