Skip to content

Commit ec5a64d

Browse files
authored
chore: Fixing retries in unit tests workflow (#3293)
1 parent 86d7adf commit ec5a64d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/run_xcodebuild_test_platforms.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ jobs:
9898
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
9999
derived_data_path: ${{ github.workspace }}/Build
100100
disable_package_resolution: true
101-
test_without_building: true
101+
# Only test without building when this exact SHA was cached or we did not restore the build from main.
102+
test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }}
102103
other_flags: ${{ inputs.other_flags }}
103104
- name: Save the SHA build cache for re-runs
104105
if: failure() && steps.retry-tests.outcome=='failure'
@@ -201,7 +202,8 @@ jobs:
201202
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
202203
derived_data_path: ${{ github.workspace }}/Build
203204
disable_package_resolution: true
204-
test_without_building: true
205+
# Only test without building when this exact SHA was cached or we did not restore the build from main.
206+
test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }}
205207
other_flags: ${{ inputs.other_flags }}
206208
- name: Save the SHA build cache for re-runs
207209
if: failure() && steps.retry-tests.outcome=='failure'
@@ -295,7 +297,8 @@ jobs:
295297
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
296298
derived_data_path: ${{ github.workspace }}/Build
297299
disable_package_resolution: true
298-
test_without_building: true
300+
# Only test without building when this exact SHA was cached or we did not restore the build from main.
301+
test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }}
299302
other_flags: ${{ inputs.other_flags }}
300303
- name: Save the SHA build cache for re-runs
301304
if: failure() && steps.retry-tests.outcome=='failure'
@@ -389,7 +392,8 @@ jobs:
389392
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
390393
derived_data_path: ${{ github.workspace }}/Build
391394
disable_package_resolution: true
392-
test_without_building: true
395+
# Only test without building when this exact SHA was cached or we did not restore the build from main.
396+
test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }}
393397
other_flags: ${{ inputs.other_flags }}
394398
- name: Save the SHA build cache for re-runs
395399
if: failure() && steps.retry-tests.outcome=='failure'

0 commit comments

Comments
 (0)