From ec5a64d12c1a330f97d142e214577c680442e06d Mon Sep 17 00:00:00 2001 From: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:54:40 -0400 Subject: [PATCH] chore: Fixing retries in unit tests workflow (#3293) --- .github/workflows/run_xcodebuild_test_platforms.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_xcodebuild_test_platforms.yml b/.github/workflows/run_xcodebuild_test_platforms.yml index 0400a12a53..b0b691a6be 100644 --- a/.github/workflows/run_xcodebuild_test_platforms.yml +++ b/.github/workflows/run_xcodebuild_test_platforms.yml @@ -98,7 +98,8 @@ jobs: cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify derived_data_path: ${{ github.workspace }}/Build disable_package_resolution: true - test_without_building: true + # Only test without building when this exact SHA was cached or we did not restore the build from main. + test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }} other_flags: ${{ inputs.other_flags }} - name: Save the SHA build cache for re-runs if: failure() && steps.retry-tests.outcome=='failure' @@ -201,7 +202,8 @@ jobs: cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify derived_data_path: ${{ github.workspace }}/Build disable_package_resolution: true - test_without_building: true + # Only test without building when this exact SHA was cached or we did not restore the build from main. + test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }} other_flags: ${{ inputs.other_flags }} - name: Save the SHA build cache for re-runs if: failure() && steps.retry-tests.outcome=='failure' @@ -295,7 +297,8 @@ jobs: cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify derived_data_path: ${{ github.workspace }}/Build disable_package_resolution: true - test_without_building: true + # Only test without building when this exact SHA was cached or we did not restore the build from main. + test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }} other_flags: ${{ inputs.other_flags }} - name: Save the SHA build cache for re-runs if: failure() && steps.retry-tests.outcome=='failure' @@ -389,7 +392,8 @@ jobs: cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify derived_data_path: ${{ github.workspace }}/Build disable_package_resolution: true - test_without_building: true + # Only test without building when this exact SHA was cached or we did not restore the build from main. + test_without_building: ${{ steps.restore-build.outputs.cache-hit || !steps.restore-main-build.outputs.cache-hit }} other_flags: ${{ inputs.other_flags }} - name: Save the SHA build cache for re-runs if: failure() && steps.retry-tests.outcome=='failure'