diff --git a/.github/composite_actions/run_xcodebuild/action.yml b/.github/composite_actions/run_xcodebuild/action.yml index e396eca8a3..bacae861b5 100644 --- a/.github/composite_actions/run_xcodebuild/action.yml +++ b/.github/composite_actions/run_xcodebuild/action.yml @@ -60,5 +60,5 @@ runs: fi xcodebuild -version - xcodebuild build -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' $otherFlags | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]} + xcodebuild $action -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' $otherFlags | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]} shell: bash \ No newline at end of file diff --git a/.github/workflows/build_amplify_swift_for_testing.yml b/.github/workflows/build_amplify_swift_for_testing.yml index df21a33611..53b96d34f8 100644 --- a/.github/workflows/build_amplify_swift_for_testing.yml +++ b/.github/workflows/build_amplify_swift_for_testing.yml @@ -16,7 +16,7 @@ permissions: concurrency: group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main'}} + cancel-in-progress: true jobs: build-for-testing-amplify-swift-iOS: @@ -58,12 +58,6 @@ jobs: with: path: ${{ github.workspace }}/Build key: amplify-iOS-latest-build-main - - name: Save the dependencies cache if necessary - if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ~/Library/Developer/Xcode/DerivedData/Amplify - key: ${{ steps.cache-packages.outputs.cache-primary-key }} build-for-testing-amplify-swift-macOS: runs-on: macos-13 @@ -126,12 +120,6 @@ jobs: disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} build_for_testing: true other_flags: '-derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify' - - name: Save the dependencies cache if necessary - if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ~/Library/Developer/Xcode/DerivedData/Amplify - key: ${{ steps.cache-packages.outputs.cache-primary-key }} build-for-testing-amplify-swift-watchOS: runs-on: macos-13 @@ -160,9 +148,3 @@ jobs: disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} build_for_testing: true other_flags: '-derivedDataPath Build -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Amplify' - - name: Save the dependencies cache if necessary - if: steps.cache-packages.outputs.cache-hit != 'true' && github.ref_name == 'main' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ~/Library/Developer/Xcode/DerivedData/Amplify - key: ${{ steps.cache-packages.outputs.cache-primary-key }} diff --git a/.github/workflows/run_xcodebuild_test_platforms.yml b/.github/workflows/run_xcodebuild_test_platforms.yml index f04193a2b8..d7b789d239 100644 --- a/.github/workflows/run_xcodebuild_test_platforms.yml +++ b/.github/workflows/run_xcodebuild_test_platforms.yml @@ -52,18 +52,19 @@ jobs: key: amplify-packages-${{ hashFiles('Package.resolved') }} restore-keys: | amplify-packages- - - name: Attempt to restore the Amplify build cache - id: restore-amplify-build - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: amplify-iOS-latest-build-main - name: Attempt to restore the scheme build cache id: restore-build uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: ${{ github.workspace }}/Build key: ${{ env.SCHEME }}-iOS-build-${{ github.sha }} + - name: Attempt to restore the Amplify build cache + if: steps.restore-build.outputs.cache-hit != true + id: restore-amplify-build + uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + with: + path: ${{ github.workspace }}/Build + key: amplify-iOS-latest-build-main - name: Run iOS Test Suite id: run-tests continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }}