diff --git a/.github/composite_actions/run_xcodebuild_test/action.yml b/.github/composite_actions/run_xcodebuild_test/action.yml index 3f377b7ef5..0881c71a84 100644 --- a/.github/composite_actions/run_xcodebuild_test/action.yml +++ b/.github/composite_actions/run_xcodebuild_test/action.yml @@ -43,6 +43,10 @@ inputs: required: false type: boolean default: false + build_for_testing: + required: false + type: boolean + default: false runs: using: "composite" @@ -97,6 +101,9 @@ runs: if [ "${{ inputs.test_without_building }}" == "true" ]; then echo "Testing without building..." action+="-without-building" + elif [ "${{ inputs.build_for_testing }}" == "true" ]; then + echo "Testing without building..." + action="build-for-testing" fi xcode-select -p diff --git a/.github/workflows/run_xcodebuild_test_platforms.yml b/.github/workflows/run_xcodebuild_test_platforms.yml index 0400a12a53..6a71d5694f 100644 --- a/.github/workflows/run_xcodebuild_test_platforms.yml +++ b/.github/workflows/run_xcodebuild_test_platforms.yml @@ -71,7 +71,20 @@ jobs: uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-iOS-latest-build-main + key: ${{ env.SCHEME }}-iOS-latest-build-maindsadasdas + - name: Build iOS Test Suite + id: build-tests + if: !steps.restore-build.outputs.cache-hit + uses: ./.github/composite_actions/run_xcodebuild_test + with: + scheme: ${{ env.SCHEME }} + destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4' + xcode_path: '/Applications/Xcode_14.3.app' + cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + derived_data_path: ${{ github.workspace }}/Build + disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} + build_for_testing: true + other_flags: ${{ inputs.other_flags }} - name: Run iOS Test Suite id: run-tests continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} @@ -84,7 +97,7 @@ jobs: cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify derived_data_path: ${{ github.workspace }}/Build disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - test_without_building: ${{ steps.restore-build.outputs.cache-hit }} + test_without_building: true other_flags: ${{ inputs.other_flags }} - name: Retry iOS Test Suite if needed if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' @@ -138,284 +151,284 @@ jobs: retention-days: 1 - test-macOS: - name: ${{ inputs.scheme }} macOS Tests - runs-on: macos-13 - timeout-minutes: ${{ inputs.timeout-minutes }} - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 - with: - persist-credentials: false - - name: Attempt to restore dependencies cache - id: cache-packages - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ~/Library/Developer/Xcode/DerivedData/Amplify - key: amplify-packages-${{ hashFiles('Package.resolved') }} - restore-keys: | - amplify-packages- - - name: Attempt to restore the build cache for this SHA - id: restore-build - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-macOS-build-${{ github.sha }} - restore-keys: | - ${{ env.SCHEME }}-macOS-build- - - name: Attempt to restore the build cache from main - if: steps.restore-build.outputs.cache-hit != 'true' - id: restore-main-build - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-macOS-latest-build-main - - name: Run macOS Test Suite - id: run-tests - continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} - uses: ./.github/composite_actions/run_xcodebuild_test - with: - scheme: ${{ env.SCHEME }} - destination: platform=macOS,arch=x86_64 - sdk: macosx - xcode_path: '/Applications/Xcode_14.3.app' - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - test_without_building: ${{ steps.restore-build.outputs.cache-hit }} - other_flags: ${{ inputs.other_flags }} - - name: Retry macOS Test Suite if needed - if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' - id: retry-tests - uses: ./.github/composite_actions/run_xcodebuild_test - with: - scheme: ${{ env.SCHEME }} - destination: platform=macOS,arch=x86_64 - sdk: macosx - xcode_path: '/Applications/Xcode_14.3.app' - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: true - test_without_building: true - other_flags: ${{ inputs.other_flags }} - - name: Save the SHA build cache for re-runs - if: failure() && steps.retry-tests.outcome=='failure' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-macOS-build-${{ github.sha }} - - name: Delete the SHA build cache on re-run success - if: steps.restore-build.outputs.cache-matched-key - env: - GH_TOKEN: ${{ github.token }} - continue-on-error: true - run: | - gh cache delete ${{ steps.restore-build.outputs.cache-matched-key }} - shell: bash - - name: Delete the old build cache on main - if: github.ref_name == 'main' && steps.restore-main-build.outputs.cache-hit - env: - GH_TOKEN: ${{ github.token }} - continue-on-error: true - run: | - gh cache delete ${{ steps.restore-main-build.outputs.cache-primary-key }} - shell: bash - - name: Save the new build cache on main - if: github.ref_name == 'main' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ steps.restore-main-build.outputs.cache-primary-key }} + # test-macOS: + # name: ${{ inputs.scheme }} macOS Tests + # runs-on: macos-13 + # timeout-minutes: ${{ inputs.timeout-minutes }} + # steps: + # - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 + # with: + # persist-credentials: false + # - name: Attempt to restore dependencies cache + # id: cache-packages + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ~/Library/Developer/Xcode/DerivedData/Amplify + # key: amplify-packages-${{ hashFiles('Package.resolved') }} + # restore-keys: | + # amplify-packages- + # - name: Attempt to restore the build cache for this SHA + # id: restore-build + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-macOS-build-${{ github.sha }} + # restore-keys: | + # ${{ env.SCHEME }}-macOS-build- + # - name: Attempt to restore the build cache from main + # if: steps.restore-build.outputs.cache-hit != 'true' + # id: restore-main-build + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-macOS-latest-build-main + # - name: Run macOS Test Suite + # id: run-tests + # continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} + # uses: ./.github/composite_actions/run_xcodebuild_test + # with: + # scheme: ${{ env.SCHEME }} + # destination: platform=macOS,arch=x86_64 + # sdk: macosx + # xcode_path: '/Applications/Xcode_14.3.app' + # cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + # derived_data_path: ${{ github.workspace }}/Build + # disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} + # test_without_building: ${{ steps.restore-build.outputs.cache-hit }} + # other_flags: ${{ inputs.other_flags }} + # - name: Retry macOS Test Suite if needed + # if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' + # id: retry-tests + # uses: ./.github/composite_actions/run_xcodebuild_test + # with: + # scheme: ${{ env.SCHEME }} + # destination: platform=macOS,arch=x86_64 + # sdk: macosx + # xcode_path: '/Applications/Xcode_14.3.app' + # cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + # derived_data_path: ${{ github.workspace }}/Build + # disable_package_resolution: true + # test_without_building: true + # other_flags: ${{ inputs.other_flags }} + # - name: Save the SHA build cache for re-runs + # if: failure() && steps.retry-tests.outcome=='failure' + # uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-macOS-build-${{ github.sha }} + # - name: Delete the SHA build cache on re-run success + # if: steps.restore-build.outputs.cache-matched-key + # env: + # GH_TOKEN: ${{ github.token }} + # continue-on-error: true + # run: | + # gh cache delete ${{ steps.restore-build.outputs.cache-matched-key }} + # shell: bash + # - name: Delete the old build cache on main + # if: github.ref_name == 'main' && steps.restore-main-build.outputs.cache-hit + # env: + # GH_TOKEN: ${{ github.token }} + # continue-on-error: true + # run: | + # gh cache delete ${{ steps.restore-main-build.outputs.cache-primary-key }} + # shell: bash + # - name: Save the new build cache on main + # if: github.ref_name == 'main' + # uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ steps.restore-main-build.outputs.cache-primary-key }} - test-tvOS: - name: ${{ inputs.scheme }} tvOS Tests - runs-on: macos-13 - timeout-minutes: ${{ inputs.timeout-minutes }} - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 - with: - persist-credentials: false - - name: Attempt to restore dependencies cache - id: cache-packages - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ~/Library/Developer/Xcode/DerivedData/Amplify - key: amplify-packages-${{ hashFiles('Package.resolved') }} - restore-keys: | - amplify-packages- - - name: Attempt to restore the build cache for this SHA - id: restore-build - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-tvOS-build-${{ github.sha }} - restore-keys: | - ${{ env.SCHEME }}-tvOS-build- - - name: Attempt to restore the build cache from main - if: steps.restore-build.outputs.cache-hit != 'true' - id: restore-main-build - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-tvOS-latest-build-main - - name: Run tvOS Test Suite - id: run-tests - continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} - uses: ./.github/composite_actions/run_xcodebuild_test - with: - scheme: ${{ env.SCHEME }} - destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4 - sdk: appletvsimulator - xcode_path: '/Applications/Xcode_14.3.app' - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - test_without_building: ${{ steps.restore-build.outputs.cache-hit }} - other_flags: ${{ inputs.other_flags }} - - name: Retry tvOS Test Suite if needed - if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' - id: retry-tests - uses: ./.github/composite_actions/run_xcodebuild_test - with: - scheme: ${{ env.SCHEME }} - destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4 - sdk: appletvsimulator - xcode_path: '/Applications/Xcode_14.3.app' - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: true - test_without_building: true - other_flags: ${{ inputs.other_flags }} - - name: Save the SHA build cache for re-runs - if: failure() && steps.retry-tests.outcome=='failure' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-tvOS-build-${{ github.sha }} - - name: Delete the SHA build cache on re-run success - if: steps.restore-build.outputs.cache-matched-key - env: - GH_TOKEN: ${{ github.token }} - continue-on-error: true - run: | - gh cache delete ${{ steps.restore-build.outputs.cache-matched-key }} - shell: bash - - name: Delete the old build cache on main - if: github.ref_name == 'main' && steps.restore-main-build.outputs.cache-hit - env: - GH_TOKEN: ${{ github.token }} - continue-on-error: true - run: | - gh cache delete ${{ steps.restore-main-build.outputs.cache-primary-key }} - shell: bash - - name: Save the new build cache on main - if: github.ref_name == 'main' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ steps.restore-main-build.outputs.cache-primary-key }} + # test-tvOS: + # name: ${{ inputs.scheme }} tvOS Tests + # runs-on: macos-13 + # timeout-minutes: ${{ inputs.timeout-minutes }} + # steps: + # - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 + # with: + # persist-credentials: false + # - name: Attempt to restore dependencies cache + # id: cache-packages + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ~/Library/Developer/Xcode/DerivedData/Amplify + # key: amplify-packages-${{ hashFiles('Package.resolved') }} + # restore-keys: | + # amplify-packages- + # - name: Attempt to restore the build cache for this SHA + # id: restore-build + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-tvOS-build-${{ github.sha }} + # restore-keys: | + # ${{ env.SCHEME }}-tvOS-build- + # - name: Attempt to restore the build cache from main + # if: steps.restore-build.outputs.cache-hit != 'true' + # id: restore-main-build + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-tvOS-latest-build-main + # - name: Run tvOS Test Suite + # id: run-tests + # continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} + # uses: ./.github/composite_actions/run_xcodebuild_test + # with: + # scheme: ${{ env.SCHEME }} + # destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4 + # sdk: appletvsimulator + # xcode_path: '/Applications/Xcode_14.3.app' + # cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + # derived_data_path: ${{ github.workspace }}/Build + # disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} + # test_without_building: ${{ steps.restore-build.outputs.cache-hit }} + # other_flags: ${{ inputs.other_flags }} + # - name: Retry tvOS Test Suite if needed + # if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' + # id: retry-tests + # uses: ./.github/composite_actions/run_xcodebuild_test + # with: + # scheme: ${{ env.SCHEME }} + # destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4 + # sdk: appletvsimulator + # xcode_path: '/Applications/Xcode_14.3.app' + # cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + # derived_data_path: ${{ github.workspace }}/Build + # disable_package_resolution: true + # test_without_building: true + # other_flags: ${{ inputs.other_flags }} + # - name: Save the SHA build cache for re-runs + # if: failure() && steps.retry-tests.outcome=='failure' + # uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-tvOS-build-${{ github.sha }} + # - name: Delete the SHA build cache on re-run success + # if: steps.restore-build.outputs.cache-matched-key + # env: + # GH_TOKEN: ${{ github.token }} + # continue-on-error: true + # run: | + # gh cache delete ${{ steps.restore-build.outputs.cache-matched-key }} + # shell: bash + # - name: Delete the old build cache on main + # if: github.ref_name == 'main' && steps.restore-main-build.outputs.cache-hit + # env: + # GH_TOKEN: ${{ github.token }} + # continue-on-error: true + # run: | + # gh cache delete ${{ steps.restore-main-build.outputs.cache-primary-key }} + # shell: bash + # - name: Save the new build cache on main + # if: github.ref_name == 'main' + # uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ steps.restore-main-build.outputs.cache-primary-key }} - test-watchOS: - name: ${{ inputs.scheme }} watchOS Tests - runs-on: macos-13 - timeout-minutes: ${{ inputs.timeout-minutes }} - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 - with: - persist-credentials: false - - name: Attempt to restore dependencies cache - id: cache-packages - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ~/Library/Developer/Xcode/DerivedData/Amplify - key: amplify-packages-${{ hashFiles('Package.resolved') }} - restore-keys: | - amplify-packages- - - name: Attempt to restore the build cache for this SHA - id: restore-build - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-watchOS-build-${{ github.sha }} - restore-keys: | - ${{ env.SCHEME }}-watchOS-build- - - name: Attempt to restore the build cache from main - if: steps.restore-build.outputs.cache-hit != 'true' - id: restore-main-build - timeout-minutes: 4 - continue-on-error: true - uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-watchOS-latest-build-main - - name: Run watchOS Test Suite - id: run-tests - continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} - uses: ./.github/composite_actions/run_xcodebuild_test - with: - scheme: ${{ env.SCHEME }} - destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4 - sdk: watchsimulator - xcode_path: '/Applications/Xcode_14.3.app' - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - test_without_building: ${{ steps.restore-build.outputs.cache-hit }} - other_flags: ${{ inputs.other_flags }} - - name: Retry watchOS Test Suite if needed - if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' - id: retry-tests - uses: ./.github/composite_actions/run_xcodebuild_test - with: - scheme: ${{ env.SCHEME }} - destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4 - sdk: watchsimulator - xcode_path: '/Applications/Xcode_14.3.app' - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: true - test_without_building: true - other_flags: ${{ inputs.other_flags }} - - name: Save the SHA build cache for re-runs - if: failure() && steps.retry-tests.outcome=='failure' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-watchOS-build-${{ github.sha }} - - name: Delete the SHA build cache on re-run success - if: steps.restore-build.outputs.cache-matched-key - env: - GH_TOKEN: ${{ github.token }} - continue-on-error: true - run: | - gh cache delete ${{ steps.restore-build.outputs.cache-matched-key }} - shell: bash - - name: Delete the old build cache on main - if: github.ref_name == 'main' && steps.restore-main-build.outputs.cache-hit - env: - GH_TOKEN: ${{ github.token }} - continue-on-error: true - run: | - gh cache delete ${{ steps.restore-main-build.outputs.cache-primary-key }} - shell: bash - - name: Save the new build cache on main - if: github.ref_name == 'main' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ steps.restore-main-build.outputs.cache-primary-key }} + # test-watchOS: + # name: ${{ inputs.scheme }} watchOS Tests + # runs-on: macos-13 + # timeout-minutes: ${{ inputs.timeout-minutes }} + # steps: + # - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 + # with: + # persist-credentials: false + # - name: Attempt to restore dependencies cache + # id: cache-packages + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ~/Library/Developer/Xcode/DerivedData/Amplify + # key: amplify-packages-${{ hashFiles('Package.resolved') }} + # restore-keys: | + # amplify-packages- + # - name: Attempt to restore the build cache for this SHA + # id: restore-build + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-watchOS-build-${{ github.sha }} + # restore-keys: | + # ${{ env.SCHEME }}-watchOS-build- + # - name: Attempt to restore the build cache from main + # if: steps.restore-build.outputs.cache-hit != 'true' + # id: restore-main-build + # timeout-minutes: 4 + # continue-on-error: true + # uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-watchOS-latest-build-main + # - name: Run watchOS Test Suite + # id: run-tests + # continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }} + # uses: ./.github/composite_actions/run_xcodebuild_test + # with: + # scheme: ${{ env.SCHEME }} + # destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4 + # sdk: watchsimulator + # xcode_path: '/Applications/Xcode_14.3.app' + # cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + # derived_data_path: ${{ github.workspace }}/Build + # disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} + # test_without_building: ${{ steps.restore-build.outputs.cache-hit }} + # other_flags: ${{ inputs.other_flags }} + # - name: Retry watchOS Test Suite if needed + # if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure' + # id: retry-tests + # uses: ./.github/composite_actions/run_xcodebuild_test + # with: + # scheme: ${{ env.SCHEME }} + # destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4 + # sdk: watchsimulator + # xcode_path: '/Applications/Xcode_14.3.app' + # cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + # derived_data_path: ${{ github.workspace }}/Build + # disable_package_resolution: true + # test_without_building: true + # other_flags: ${{ inputs.other_flags }} + # - name: Save the SHA build cache for re-runs + # if: failure() && steps.retry-tests.outcome=='failure' + # uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ env.SCHEME }}-watchOS-build-${{ github.sha }} + # - name: Delete the SHA build cache on re-run success + # if: steps.restore-build.outputs.cache-matched-key + # env: + # GH_TOKEN: ${{ github.token }} + # continue-on-error: true + # run: | + # gh cache delete ${{ steps.restore-build.outputs.cache-matched-key }} + # shell: bash + # - name: Delete the old build cache on main + # if: github.ref_name == 'main' && steps.restore-main-build.outputs.cache-hit + # env: + # GH_TOKEN: ${{ github.token }} + # continue-on-error: true + # run: | + # gh cache delete ${{ steps.restore-main-build.outputs.cache-primary-key }} + # shell: bash + # - name: Save the new build cache on main + # if: github.ref_name == 'main' + # uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + # with: + # path: ${{ github.workspace }}/Build + # key: ${{ steps.restore-main-build.outputs.cache-primary-key }} diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index d329901675..d19cf5849c 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -21,18 +21,18 @@ concurrency: cancel-in-progress: ${{ github.ref_name != 'main'}} jobs: - unit-tests-without-coverage: - name: ${{ matrix.scheme }} Unit Tests - strategy: - fail-fast: false - matrix: - scheme: [ - InternalAWSPinpointUnitTests - ] - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml - with: - scheme: ${{ matrix.scheme }} - generate_coverage_report: false + # unit-tests-without-coverage: + # name: ${{ matrix.scheme }} Unit Tests + # strategy: + # fail-fast: false + # matrix: + # scheme: [ + # InternalAWSPinpointUnitTests + # ] + # uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + # with: + # scheme: ${{ matrix.scheme }} + # generate_coverage_report: false unit-tests-with-coverage: name: ${{ matrix.scheme }} Unit Tests @@ -40,18 +40,18 @@ jobs: fail-fast: false matrix: scheme: [ - Amplify, - AWSPluginsCore, - AWSAPIPlugin, - AWSCloudWatchLoggingPlugin, + # Amplify, + # AWSPluginsCore, + # AWSAPIPlugin, + # AWSCloudWatchLoggingPlugin, AWSCognitoAuthPlugin, - AWSDataStorePlugin, - AWSLocationGeoPlugin, - AWSPredictionsPlugin, - AWSPinpointAnalyticsPlugin, - AWSPinpointPushNotificationsPlugin, - AWSS3StoragePlugin, - CoreMLPredictionsPlugin + # AWSDataStorePlugin, + # AWSLocationGeoPlugin, + # AWSPredictionsPlugin, + # AWSPinpointAnalyticsPlugin, + # AWSPinpointPushNotificationsPlugin, + # AWSS3StoragePlugin, + # CoreMLPredictionsPlugin ] uses: ./.github/workflows/run_xcodebuild_test_platforms.yml with: @@ -65,18 +65,18 @@ jobs: fail-fast: false matrix: file: [ - { scheme: Amplify, flags: 'Amplify,unit_tests' }, - { scheme: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' }, - { scheme: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' }, - { scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' }, + # { scheme: Amplify, flags: 'Amplify,unit_tests' }, + # { scheme: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' }, + # { scheme: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' }, + # { scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' }, { scheme: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' }, - { scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' }, - { scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' }, - { scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' }, - { scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' }, - { scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' }, - { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' }, - { scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' } + # { scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' }, + # { scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' }, + # { scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' }, + # { scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' }, + # { scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' }, + # { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' }, + # { scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' } ] uses: ./.github/workflows/upload_coverage_report.yml with: @@ -89,7 +89,7 @@ jobs: if: ${{ !cancelled() }} needs: [ unit-tests-with-coverage, - unit-tests-without-coverage + # unit-tests-without-coverage ] env: EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }} diff --git a/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/Support/AWSAuthCognitoSessionTests.swift b/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/Support/AWSAuthCognitoSessionTests.swift index fdb8862284..206c300847 100644 --- a/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/Support/AWSAuthCognitoSessionTests.swift +++ b/AmplifyPlugins/Auth/Tests/AWSCognitoAuthPluginUnitTests/Support/AWSAuthCognitoSessionTests.swift @@ -61,7 +61,7 @@ class AWSAuthCognitoSessionTests: XCTestCase { awsCredentialsResult: .failure(error), cognitoTokensResult: .success(tokens)) - let cognitoTokens = try! session.getCognitoTokens().get() as! AWSCognitoUserPoolTokens + let cognitoTokens = try! session.getCognitoTokens().get() as! String XCTAssertFalse(cognitoTokens.doesExpire()) }