From ae59b0aeaae8b781e516e3e37cacb459c3be2a2c Mon Sep 17 00:00:00 2001 From: Sebastian Villena <97059974+ruisebas@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:00:01 -0500 Subject: [PATCH] chore(workflows): caching one build for Amplify-Package instead of one for each plugin (#3342) --- .../run_xcodebuild/action.yml | 22 + .github/workflows/build_amplify_swift.yml | 177 ++------ .../build_amplify_swift_platforms.yml | 67 +++ .github/workflows/deploy_package.yml | 2 +- .github/workflows/integ_test_analytics.yml | 7 +- .../workflows/integ_test_api_functional.yml | 7 +- .../integ_test_api_graphql_auth_directive.yml | 5 +- .../workflows/integ_test_api_graphql_iam.yml | 5 +- .../integ_test_api_graphql_lambda_auth.yml | 7 +- .../integ_test_api_graphql_lazy_load.yml | 5 +- .../integ_test_api_graphql_user_pool.yml | 5 +- .github/workflows/integ_test_api_rest_iam.yml | 7 +- .../integ_test_api_rest_user_pool.yml | 5 +- .github/workflows/integ_test_auth.yml | 8 +- .../integ_test_datastore_auth_cognito.yml | 7 +- .../integ_test_datastore_auth_iam.yml | 7 +- .../workflows/integ_test_datastore_base.yml | 7 +- .../workflows/integ_test_datastore_cpk.yml | 7 +- .../integ_test_datastore_lazy_load.yml | 7 +- .../integ_test_datastore_multi_auth.yml | 7 +- .github/workflows/integ_test_datastore_v2.yml | 7 +- .github/workflows/integ_test_geo.yml | 7 +- .github/workflows/integ_test_logging.yml | 9 +- .github/workflows/integ_test_predictions.yml | 7 +- .../integ_test_push_notifications.yml | 10 +- .github/workflows/integ_test_storage.yml | 7 +- .../workflows/nightly_repeated_unittest.yml | 2 +- .github/workflows/run_integration_tests.yml | 8 +- .github/workflows/run_unit_tests.yml | 110 +++++ .../workflows/run_unit_tests_platforms.yml | 41 ++ .../run_xcodebuild_test_platforms.yml | 425 ------------------ .github/workflows/unit_test.yml | 28 +- .github/workflows/unit_test_amplify.yml | 23 +- .github/workflows/unit_test_analytics.yml | 23 +- .github/workflows/unit_test_api.yml | 23 +- .github/workflows/unit_test_auth.yml | 23 +- .github/workflows/unit_test_core.yml | 23 +- .github/workflows/unit_test_datastore.yml | 23 +- .github/workflows/unit_test_geo.yml | 23 +- .../workflows/unit_test_internal_pinpoint.yml | 23 +- .github/workflows/unit_test_logging.yml | 23 +- .github/workflows/unit_test_predictions.yml | 25 +- .../unit_test_push_notifications.yml | 23 +- .github/workflows/unit_test_storage.yml | 23 +- .github/workflows/upload_coverage_report.yml | 2 +- .../xcschemes/Amplify-Package.xcscheme | 197 ++++---- 46 files changed, 757 insertions(+), 752 deletions(-) create mode 100644 .github/workflows/build_amplify_swift_platforms.yml create mode 100644 .github/workflows/run_unit_tests.yml create mode 100644 .github/workflows/run_unit_tests_platforms.yml delete mode 100644 .github/workflows/run_xcodebuild_test_platforms.yml diff --git a/.github/composite_actions/run_xcodebuild/action.yml b/.github/composite_actions/run_xcodebuild/action.yml index 1a39188604..d5567939bf 100644 --- a/.github/composite_actions/run_xcodebuild/action.yml +++ b/.github/composite_actions/run_xcodebuild/action.yml @@ -19,6 +19,14 @@ inputs: required: false type: string default: 'iphonesimulator' + cloned_source_packages_path: + required: false + type: string + default: '' + derived_data_path: + required: false + type: string + default: '' disable_package_resolution: required: false type: boolean @@ -36,6 +44,8 @@ runs: SCHEME: ${{ inputs.scheme }} PROJECT_PATH: ${{ inputs.project_path }} XCODE_PATH: ${{ inputs.xcode_path }} + CLONED_SOURCE_PACKAGES_PATH: ${{ inputs.cloned_source_packages_path }} + DERIVED_DATA_PATH: ${{ inputs.derived_data_path }} run: | if [ ! -z "$PROJECT_PATH" ]; then cd $PROJECT_PATH @@ -46,8 +56,20 @@ runs: otherFlags="${{ inputs.other_flags }}" if [ "${{ inputs.disable_package_resolution }}" == "true" ]; then + echo "Disabling Automatic Package Resolution" otherFlags+=" -disableAutomaticPackageResolution" fi + + if [ ! -z "$DERIVED_DATA_PATH" ]; then + echo "Using custom DerivedData path" + otherFlags+=" -derivedDataPath $DERIVED_DATA_PATH" + fi + + if [ ! -z "$CLONED_SOURCE_PACKAGES_PATH" ]; then + echo "Using custom cloned source packages path" + otherFlags+=" -clonedSourcePackagesDirPath $CLONED_SOURCE_PACKAGES_PATH" + fi + xcodebuild -version xcodebuild build -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.yml b/.github/workflows/build_amplify_swift.yml index 35ed0b77f3..67b5a835b6 100644 --- a/.github/workflows/build_amplify_swift.yml +++ b/.github/workflows/build_amplify_swift.yml @@ -1,33 +1,34 @@ -name: Build | Amplify Swift +name: Build Amplify-Package for the given platform on: workflow_call: inputs: - identifier: - required: true + platform: type: string - workflow_dispatch: - push: - branches-ignore: - - main - - release + required: true permissions: - contents: read - -concurrency: - group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: ${{ github.ref_name != 'main'}} + contents: read + actions: write jobs: - build-amplify-swift-iOS: + build-amplify-swift: + name: Build Amplify-Package | ${{ inputs.platform }} runs-on: macos-13 - timeout-minutes: 20 steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 + - name: Checkout repository + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 with: persist-credentials: false - - name: Attempt to restore dependencies cache - id: cache-packages + + - name: Get build parameters for ${{ inputs.platform }} + id: platform + uses: ./.github/composite_actions/get_platform_parameters + with: + platform: ${{ inputs.platform }} + xcode_version: '14.3' + + - name: Attempt to use the dependencies cache + id: dependencies-cache timeout-minutes: 4 continue-on-error: true uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 @@ -36,131 +37,47 @@ jobs: key: amplify-packages-${{ hashFiles('Package.resolved') }} restore-keys: | amplify-packages- - - name: Build Amplify Swift for iOS - uses: ./.github/composite_actions/run_xcodebuild - with: - scheme: Amplify-Package - destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4' - xcode_path: '/Applications/Xcode_14.3.app' - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - 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-amplify-swift-macOS: - runs-on: macos-13 - timeout-minutes: 20 - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 - with: - persist-credentials: false - - name: Attempt to restore dependencies cache - id: cache-packages + - name: Attempt to restore the build cache from main + id: build-cache 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: Build Amplify Swift for macOS - uses: ./.github/composite_actions/run_xcodebuild - with: - scheme: Amplify-Package - destination: platform=macOS,arch=x86_64 - sdk: macosx - xcode_path: '/Applications/Xcode_14.3.app' - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - 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 }} + path: ${{ github.workspace }}/Build + key: Amplify-${{ inputs.platform }}-build-cache - build-amplify-swift-tvOS: - runs-on: macos-13 - timeout-minutes: 20 - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 - with: - persist-credentials: false - - name: Attempt to restore dependencies cache - timeout-minutes: 4 - id: cache-packages + - name: Build Amplify for Swift + id: build-package 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: Build Amplify Swift for tvOS uses: ./.github/composite_actions/run_xcodebuild with: scheme: Amplify-Package - destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4 - sdk: appletvsimulator - xcode_path: '/Applications/Xcode_14.3.app' - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - 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' + destination: ${{ steps.platform.outputs.destination }} + sdk: ${{ steps.platform.outputs.sdk }} + 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.dependencies-cache.outputs.cache-hit }} + + - name: Save the dependencies cache in main + if: steps.dependencies-cache.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-amplify-swift-watchOS: - runs-on: macos-13 - timeout-minutes: 20 - steps: - - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 - with: - persist-credentials: false - - name: Attempt to restore dependencies cache - id: cache-packages - timeout-minutes: 4 + key: ${{ steps.dependencies-cache.outputs.cache-primary-key }} + + - name: Delete the old build cache + if: steps.build-cache.outputs.cache-hit && github.ref_name == 'main' + env: + GH_TOKEN: ${{ github.token }} 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: Build Amplify Swift for watchOS - uses: ./.github/composite_actions/run_xcodebuild - with: - scheme: Amplify-Package - destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4 - sdk: watchsimulator - xcode_path: '/Applications/Xcode_14.3.app' - disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }} - 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' + run: | + gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }} + + - name: Save the build cache + if: 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 }} - - confirm-pass: - runs-on: ubuntu-latest - name: Confirm Passing Build Steps - if: ${{ !cancelled() }} - needs: [ - build-amplify-swift-iOS, - build-amplify-swift-macOS, - build-amplify-swift-tvOS, - build-amplify-swift-watchOS - ] - env: - EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }} - steps: - - run: exit $EXIT_CODE + path: ${{ github.workspace }}/Build + key: ${{ steps.build-cache.outputs.cache-primary-key }} \ No newline at end of file diff --git a/.github/workflows/build_amplify_swift_platforms.yml b/.github/workflows/build_amplify_swift_platforms.yml new file mode 100644 index 0000000000..54fc16d50e --- /dev/null +++ b/.github/workflows/build_amplify_swift_platforms.yml @@ -0,0 +1,67 @@ +name: Build | Amplify Swift +on: + workflow_call: + inputs: + identifier: + required: true + type: string + workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean + push: + branches-ignore: + - main + - release + +permissions: + contents: read + actions: write + +concurrency: + group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref_name != 'main'}} + +jobs: + build-amplify-swift: + name: Build Amplify Swift for ${{ matrix.platform }} + strategy: + fail-fast: false + matrix: + platform: [iOS, macOS, tvOS, watchOS] + exclude: + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.macos == 'false' && 'macOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} + uses: ./.github/workflows/build_amplify_swift.yml + with: + platform: ${{ matrix.platform }} + + confirm-pass: + runs-on: ubuntu-latest + name: Confirm Passing Build Steps + if: ${{ !cancelled() }} + needs: [ build-amplify-swift ] + env: + EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }} + steps: + - run: exit $EXIT_CODE diff --git a/.github/workflows/deploy_package.yml b/.github/workflows/deploy_package.yml index 209bcf863a..37e6b7c75e 100644 --- a/.github/workflows/deploy_package.yml +++ b/.github/workflows/deploy_package.yml @@ -16,7 +16,7 @@ permissions: jobs: build-amplify-swift: name: Build Amplify package - uses: ./.github/workflows/build_amplify_swift.yml + uses: ./.github/workflows/build_amplify_swift_platforms.yml with: identifier: 'workflow-call-build-amplify-swift' diff --git a/.github/workflows/integ_test_analytics.yml b/.github/workflows/integ_test_analytics.yml index f88d59e0ce..6f0de7f368 100644 --- a/.github/workflows/integ_test_analytics.yml +++ b/.github/workflows/integ_test_analytics.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSPinpointAnalyticsPluginIntegrationTestsWatch' || 'AWSPinpointAnalyticsPluginIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSPinpointAnalyticsPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/Analytics/Tests/AnalyticsHostApp xcode_version: '14.3' resource_subfolder: analytics diff --git a/.github/workflows/integ_test_api_functional.yml b/.github/workflows/integ_test_api_functional.yml index c8874243fe..a63a05eb28 100644 --- a/.github/workflows/integ_test_api_functional.yml +++ b/.github/workflows/integ_test_api_functional.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginFunctionalTestsWatch' || 'AWSAPIPluginFunctionalTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_graphql_auth_directive.yml b/.github/workflows/integ_test_api_graphql_auth_directive.yml index 46ff30d925..33dba6c1d5 100644 --- a/.github/workflows/integ_test_api_graphql_auth_directive.yml +++ b/.github/workflows/integ_test_api_graphql_auth_directive.yml @@ -26,13 +26,12 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: AWSAPIPluginGraphQLAuthDirectiveTests platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_graphql_iam.yml b/.github/workflows/integ_test_api_graphql_iam.yml index 94dccec965..e1631664ea 100644 --- a/.github/workflows/integ_test_api_graphql_iam.yml +++ b/.github/workflows/integ_test_api_graphql_iam.yml @@ -26,13 +26,12 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: AWSAPIPluginGraphQLIAMTests platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_graphql_lambda_auth.yml b/.github/workflows/integ_test_api_graphql_lambda_auth.yml index f1f699f851..49388053a2 100644 --- a/.github/workflows/integ_test_api_graphql_lambda_auth.yml +++ b/.github/workflows/integ_test_api_graphql_lambda_auth.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginGraphQLLambdaAuthTestsWatch' || 'AWSAPIPluginGraphQLLambdaAuthTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_graphql_lazy_load.yml b/.github/workflows/integ_test_api_graphql_lazy_load.yml index 332e71eec5..849c329625 100644 --- a/.github/workflows/integ_test_api_graphql_lazy_load.yml +++ b/.github/workflows/integ_test_api_graphql_lazy_load.yml @@ -26,13 +26,12 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: AWSAPIPluginLazyLoadTests platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_graphql_user_pool.yml b/.github/workflows/integ_test_api_graphql_user_pool.yml index e3f10fd1eb..21f1205eb6 100644 --- a/.github/workflows/integ_test_api_graphql_user_pool.yml +++ b/.github/workflows/integ_test_api_graphql_user_pool.yml @@ -26,13 +26,12 @@ jobs: matrix: platform: [iOS, tvOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: AWSAPIPluginGraphQLUserPoolTests platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_rest_iam.yml b/.github/workflows/integ_test_api_rest_iam.yml index aa3b203b3f..18a14615bf 100644 --- a/.github/workflows/integ_test_api_rest_iam.yml +++ b/.github/workflows/integ_test_api_rest_iam.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginRESTIAMTestsWatch' || 'AWSAPIPluginRESTIAMTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_api_rest_user_pool.yml b/.github/workflows/integ_test_api_rest_user_pool.yml index c88f87099b..96c141316e 100644 --- a/.github/workflows/integ_test_api_rest_user_pool.yml +++ b/.github/workflows/integ_test_api_rest_user_pool.yml @@ -26,13 +26,12 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: AWSAPIPluginRESTUserPoolTests platform: ${{ matrix.platform }} - build_cache_key: AWSAPIPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/API/Tests/APIHostApp xcode_version: '14.3' resource_subfolder: api diff --git a/.github/workflows/integ_test_auth.yml b/.github/workflows/integ_test_auth.yml index fef7e2c13a..e90900e0ee 100644 --- a/.github/workflows/integ_test_auth.yml +++ b/.github/workflows/integ_test_auth.yml @@ -36,14 +36,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AuthIntegrationTestsWatch' || 'AuthIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSCognitoAuthPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/Auth/Tests/AuthHostApp/ xcode_version: '14.3' resource_subfolder: auth @@ -56,7 +55,6 @@ jobs: with: scheme: AuthHostedUIApp platform: iOS - build_cache_key: AWSCognitoAuthPlugin-iOS-latest-build-main project_path: ./AmplifyPlugins/Auth/Tests/AuthHostedUIApp/ xcode_version: '14.3' resource_subfolder: auth diff --git a/.github/workflows/integ_test_datastore_auth_cognito.yml b/.github/workflows/integ_test_datastore_auth_cognito.yml index 7ed891f883..cd611d7f82 100644 --- a/.github/workflows/integ_test_datastore_auth_cognito.yml +++ b/.github/workflows/integ_test_datastore_auth_cognito.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginAuthCognitoTestsWatch' || 'AWSDataStorePluginAuthCognitoTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_datastore_auth_iam.yml b/.github/workflows/integ_test_datastore_auth_iam.yml index 3b2f4af585..9c5c25a948 100644 --- a/.github/workflows/integ_test_datastore_auth_iam.yml +++ b/.github/workflows/integ_test_datastore_auth_iam.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginAuthIAMTestsWatch' || 'AWSDataStorePluginAuthIAMTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_datastore_base.yml b/.github/workflows/integ_test_datastore_base.yml index 06c51f8785..5a3ca820df 100644 --- a/.github/workflows/integ_test_datastore_base.yml +++ b/.github/workflows/integ_test_datastore_base.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginIntegrationTestsWatch' || 'AWSDataStorePluginIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_datastore_cpk.yml b/.github/workflows/integ_test_datastore_cpk.yml index 8e97bb1e07..350def730c 100644 --- a/.github/workflows/integ_test_datastore_cpk.yml +++ b/.github/workflows/integ_test_datastore_cpk.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginCPKTestsWatch' || 'AWSDataStorePluginCPKTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_datastore_lazy_load.yml b/.github/workflows/integ_test_datastore_lazy_load.yml index 388d28f1d2..c54e405359 100644 --- a/.github/workflows/integ_test_datastore_lazy_load.yml +++ b/.github/workflows/integ_test_datastore_lazy_load.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginLazyLoadTestsWatch' || 'AWSDataStorePluginLazyLoadTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_datastore_multi_auth.yml b/.github/workflows/integ_test_datastore_multi_auth.yml index e8900c4f24..df5ccd69bd 100644 --- a/.github/workflows/integ_test_datastore_multi_auth.yml +++ b/.github/workflows/integ_test_datastore_multi_auth.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginMultiAuthTestsWatch' || 'AWSDataStorePluginMultiAuthTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_datastore_v2.yml b/.github/workflows/integ_test_datastore_v2.yml index f842b38c13..1b44b75248 100644 --- a/.github/workflows/integ_test_datastore_v2.yml +++ b/.github/workflows/integ_test_datastore_v2.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginV2TestsWatch' || 'AWSDataStorePluginV2Tests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSDataStorePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp xcode_version: '14.3' resource_subfolder: datastore diff --git a/.github/workflows/integ_test_geo.yml b/.github/workflows/integ_test_geo.yml index 7effa17ab9..2bc9cb0ced 100644 --- a/.github/workflows/integ_test_geo.yml +++ b/.github/workflows/integ_test_geo.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSLocationGeoPluginIntegrationTestsWatch' || 'AWSLocationGeoPluginIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSLocationGeoPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/Geo/Tests/GeoHostApp/ xcode_version: '14.3' resource_subfolder: geo diff --git a/.github/workflows/integ_test_logging.yml b/.github/workflows/integ_test_logging.yml index 770b87a2fb..d591dcfe33 100644 --- a/.github/workflows/integ_test_logging.yml +++ b/.github/workflows/integ_test_logging.yml @@ -31,16 +31,15 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSCloudWatchLoggingPluginIntegrationTestsWatch' || 'AWSCloudWatchLoggingPluginIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSCloudWatchLoggingPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/Logging/Tests/AWSCloudWatchLoggingPluginHostApp xcode_version: ${{ matrix.platform == 'watchOS' && '15.0' || '14.3' }} resource_subfolder: logging - timeout-minutes: 45 + timeout-minutes: 60 secrets: inherit diff --git a/.github/workflows/integ_test_predictions.yml b/.github/workflows/integ_test_predictions.yml index a555d2d43b..7cf53e3378 100644 --- a/.github/workflows/integ_test_predictions.yml +++ b/.github/workflows/integ_test_predictions.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSPredictionsPluginIntegrationTestsWatch' || 'AWSPredictionsPluginIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSPredictionsPlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/Predictions/Tests/PredictionsHostApp xcode_version: '14.3' resource_subfolder: predictions diff --git a/.github/workflows/integ_test_push_notifications.yml b/.github/workflows/integ_test_push_notifications.yml index 0cbc663f54..5f0e1df437 100644 --- a/.github/workflows/integ_test_push_notifications.yml +++ b/.github/workflows/integ_test_push_notifications.yml @@ -34,9 +34,9 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} steps: - name: Checkout repository uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 @@ -78,14 +78,14 @@ jobs: restore-keys: | amplify-packages- - - name: Attempt to use the provided build cache + - name: Attempt to restore the build cache id: build-cache timeout-minutes: 4 continue-on-error: true uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: ${{ github.workspace }}/Build - key: AWSPinpointPushNotificationsPlugin-${{ matrix.platform }}-latest-build-main + key: Amplify-${{ matrix.platform }}-build-cache - name: Run Local Server run: | diff --git a/.github/workflows/integ_test_storage.yml b/.github/workflows/integ_test_storage.yml index af7e50b00f..22fc5bb90e 100644 --- a/.github/workflows/integ_test_storage.yml +++ b/.github/workflows/integ_test_storage.yml @@ -31,14 +31,13 @@ jobs: matrix: platform: [iOS, tvOS, watchOS] exclude: - - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'Dummy' }} - - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'Dummy' }} + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} uses: ./.github/workflows/run_integration_tests.yml with: scheme: ${{ matrix.platform == 'watchOS' && 'AWSS3StoragePluginIntegrationTestsWatch' || 'AWSS3StoragePluginIntegrationTests' }} platform: ${{ matrix.platform }} - build_cache_key: AWSS3StoragePlugin-${{ matrix.platform }}-latest-build-main project_path: ./AmplifyPlugins/Storage/Tests/StorageHostApp/ xcode_version: '14.3' resource_subfolder: storage diff --git a/.github/workflows/nightly_repeated_unittest.yml b/.github/workflows/nightly_repeated_unittest.yml index fbd3be44d5..c5e6aa151a 100644 --- a/.github/workflows/nightly_repeated_unittest.yml +++ b/.github/workflows/nightly_repeated_unittest.yml @@ -32,7 +32,7 @@ jobs: CoreMLPredictionsPlugin, InternalAWSPinpointUnitTests ] - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: ${{ matrix.scheme }} timeout-minutes: 50 diff --git a/.github/workflows/run_integration_tests.yml b/.github/workflows/run_integration_tests.yml index a96200bc3b..500f10095a 100644 --- a/.github/workflows/run_integration_tests.yml +++ b/.github/workflows/run_integration_tests.yml @@ -25,10 +25,6 @@ on: required: false type: number default: 30 - build_cache_key: - description: 'The key used to retrieve the build cache' - required: true - type: string permissions: id-token: write @@ -77,14 +73,14 @@ jobs: restore-keys: | amplify-packages- - - name: Attempt to use the provided build cache + - name: Attempt to restore the build cache id: build-cache timeout-minutes: 4 continue-on-error: true uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: path: ${{ github.workspace }}/Build - key: ${{ inputs.build_cache_key }} + key: Amplify-${{ inputs.platform }}-build-cache - name: Run ${{ inputs.platform }} Integration Tests id: run-tests diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml new file mode 100644 index 0000000000..518f74b1a4 --- /dev/null +++ b/.github/workflows/run_unit_tests.yml @@ -0,0 +1,110 @@ +name: Run Unit Tests for the given parameters +on: + workflow_call: + inputs: + scheme: + description: 'The scheme to run the tests' + required: true + type: string + platform: + description: 'The platform in which to run these tests' + required: true + type: string + project_path: + required: false + type: string + xcode_version: + description: 'The version of Xcode used to run these tests' + required: true + type: string + timeout-minutes: + description: 'The timeout for each execution' + required: false + type: number + default: 30 + generate_coverage_report: + description: 'Whether to generate and report code coverage' + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + unit-tests: + name: ${{ inputs.platform }} Tests | ${{ inputs.scheme }} + runs-on: macos-13 + timeout-minutes: ${{ inputs.timeout-minutes }} + steps: + - name: Checkout repository + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3 + with: + persist-credentials: false + + - name: Get build parameters for ${{ inputs.platform}} + id: platform + uses: ./.github/composite_actions/get_platform_parameters + with: + platform: ${{ inputs.platform }} + xcode_version: ${{ inputs.xcode_version }} + + - name: Attempt to use the dependencies cache + id: dependencies-cache + 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 + id: build-cache + timeout-minutes: 4 + continue-on-error: true + uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 + with: + path: ${{ github.workspace }}/Build + key: Amplify-${{ inputs.platform }}-build-cache + + - name: Run ${{ inputs.platform }} Unit Tests + id: run-tests + continue-on-error: true + uses: ./.github/composite_actions/run_xcodebuild_test + with: + scheme: ${{ inputs.scheme }} + destination: ${{ steps.platform.outputs.destination }} + sdk: ${{ steps.platform.outputs.sdk }} + xcode_path: /Applications/Xcode_${{ inputs.xcode_version }}.app + generate_coverage: ${{ inputs.generate_coverage_report }} + cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + derived_data_path: ${{ github.workspace }}/Build + disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }} + other_flags: -test-iterations 3 -retry-tests-on-failure + + - name: Retry ${{ inputs.platform }} Unit Tests + if: steps.run-tests.outcome=='failure' + id: retry-tests + uses: ./.github/composite_actions/run_xcodebuild_test + with: + scheme: ${{ inputs.scheme }} + destination: ${{ steps.platform.outputs.destination }} + sdk: ${{ steps.platform.outputs.sdk }} + xcode_path: /Applications/Xcode_${{ inputs.xcode_version }}.app + project_path: ${{ inputs.project_path }} + generate_coverage: ${{ inputs.generate_coverage_report }} + cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify + derived_data_path: ${{ github.workspace }}/Build + disable_package_resolution: true + other_flags: -test-iterations 3 -retry-tests-on-failure + + - name: Store Coverage Report File + if: ${{ inputs.generate_coverage_report == true }} + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2 + with: + name: ${{ inputs.scheme }}-Coverage-${{ github.sha }} + path: ${{ github.workspace }}/${{ inputs.scheme }}-Coverage.lcov + if-no-files-found: error + retention-days: 1 diff --git a/.github/workflows/run_unit_tests_platforms.yml b/.github/workflows/run_unit_tests_platforms.yml new file mode 100644 index 0000000000..f5df65aafa --- /dev/null +++ b/.github/workflows/run_unit_tests_platforms.yml @@ -0,0 +1,41 @@ +name: Run Unit Tests for the given scheme on all supported platforms +on: + workflow_call: + inputs: + scheme: + description: 'The scheme to run the tests' + required: true + type: string + timeout-minutes: + description: 'The timeout for each execution' + required: false + type: number + default: 30 + generate_coverage_report: + description: 'Whether to generate and report code coverage' + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + run-unit-tests: + name: ${{ matrix.platform }} Tests | ${{ inputs.scheme }} + strategy: + fail-fast: false + matrix: + platform: [iOS, macOS, tvOS, watchOS] + exclude: + - platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }} + - platform: ${{ github.event.inputs.macos == 'false' && 'macOS' || 'None' }} + - platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }} + - platform: ${{ github.event.inputs.watchos == 'false' && 'watchOS' || 'None' }} + uses: ./.github/workflows/run_unit_tests.yml + with: + scheme: ${{ inputs.scheme }} + platform: ${{ matrix.platform }} + xcode_version: '14.3' + generate_coverage_report: ${{ github.event_name != 'workflow_dispatch' && matrix.platform == 'iOS' && inputs.generate_coverage_report }} + timeout-minutes: ${{ inputs.timeout-minutes }} \ No newline at end of file diff --git a/.github/workflows/run_xcodebuild_test_platforms.yml b/.github/workflows/run_xcodebuild_test_platforms.yml deleted file mode 100644 index b0b691a6be..0000000000 --- a/.github/workflows/run_xcodebuild_test_platforms.yml +++ /dev/null @@ -1,425 +0,0 @@ -name: Run xcodebuild test on all supported platforms -on: - workflow_call: - inputs: - scheme: - description: 'The scheme to run the tests' - required: true - type: string - timeout-minutes: - description: 'The timeout for each execution' - required: false - type: number - default: 30 - generate_coverage_report: - description: 'Whether to generate and report code coverage' - required: false - type: boolean - default: false - retry_on_error: - description: 'Whether to automatically retry if the tests fail' - required: false - type: boolean - default: true - other_flags: - required: false - type: string - default: '' - -env: - SCHEME: ${{ inputs.scheme }} - RETRY_ON_ERROR: ${{ inputs.retry_on_error }} - -permissions: - contents: read - actions: write - -jobs: - test-iOS: - name: ${{ inputs.scheme }} iOS 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 }}-iOS-build-${{ github.sha }} - restore-keys: | - ${{ env.SCHEME }}-iOS-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 }}-iOS-latest-build-main - - name: Run iOS 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=iOS Simulator,name=iPhone 14,OS=16.4' - xcode_path: '/Applications/Xcode_14.3.app' - generate_coverage: ${{ inputs.generate_coverage_report }} - 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 iOS 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=iOS Simulator,name=iPhone 14,OS=16.4' - xcode_path: '/Applications/Xcode_14.3.app' - generate_coverage: ${{ inputs.generate_coverage_report }} - cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify - derived_data_path: ${{ github.workspace }}/Build - disable_package_resolution: 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' - uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 - with: - path: ${{ github.workspace }}/Build - key: ${{ env.SCHEME }}-iOS-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 }} - - name: Upload Report File - if: ${{ inputs.generate_coverage_report == true }} - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2 - with: - name: ${{ env.SCHEME }}-Coverage-${{ github.sha }} - path: ${{ github.workspace }}/${{ env.SCHEME }}-Coverage.lcov - if-no-files-found: error - 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 - # 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' - 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 - # 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' - 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 - # 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' - 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..7873f7b5d8 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -7,6 +7,27 @@ on: type: string workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean push: branches-ignore: - main @@ -14,7 +35,6 @@ on: permissions: contents: read - actions: write concurrency: group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -29,7 +49,7 @@ jobs: scheme: [ InternalAWSPinpointUnitTests ] - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: ${{ matrix.scheme }} generate_coverage_report: false @@ -53,13 +73,13 @@ jobs: AWSS3StoragePlugin, CoreMLPredictionsPlugin ] - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: ${{ matrix.scheme }} generate_coverage_report: true report-coverage: - name: ${{ matrix.file.scheme }} Coverage Report + name: ${{ matrix.file.scheme }} Unit Tests needs: [unit-tests-with-coverage] strategy: fail-fast: false diff --git a/.github/workflows/unit_test_amplify.yml b/.github/workflows/unit_test_amplify.yml index 9003e6fcf1..fd6189cdd8 100644 --- a/.github/workflows/unit_test_amplify.yml +++ b/.github/workflows/unit_test_amplify.yml @@ -1,12 +1,33 @@ name: Unit Tests | Amplify on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: amplify-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: Amplify diff --git a/.github/workflows/unit_test_analytics.yml b/.github/workflows/unit_test_analytics.yml index bd2c7e45a9..94108b08c4 100644 --- a/.github/workflows/unit_test_analytics.yml +++ b/.github/workflows/unit_test_analytics.yml @@ -1,12 +1,33 @@ name: Unit Tests | Analytics on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: analytics-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSPinpointAnalyticsPlugin diff --git a/.github/workflows/unit_test_api.yml b/.github/workflows/unit_test_api.yml index b62bb2f030..75a135c36c 100644 --- a/.github/workflows/unit_test_api.yml +++ b/.github/workflows/unit_test_api.yml @@ -1,12 +1,33 @@ name: Unit Tests | API on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: api-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSAPIPlugin diff --git a/.github/workflows/unit_test_auth.yml b/.github/workflows/unit_test_auth.yml index 67148635b3..f1c6e982b8 100644 --- a/.github/workflows/unit_test_auth.yml +++ b/.github/workflows/unit_test_auth.yml @@ -1,12 +1,33 @@ name: Unit Tests | Auth on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: auth-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSCognitoAuthPlugin diff --git a/.github/workflows/unit_test_core.yml b/.github/workflows/unit_test_core.yml index 271087d9ce..252c28b5e0 100644 --- a/.github/workflows/unit_test_core.yml +++ b/.github/workflows/unit_test_core.yml @@ -1,12 +1,33 @@ name: Unit Tests | Core on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: core-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSPluginsCore diff --git a/.github/workflows/unit_test_datastore.yml b/.github/workflows/unit_test_datastore.yml index 95c4e5a036..43e31f643c 100644 --- a/.github/workflows/unit_test_datastore.yml +++ b/.github/workflows/unit_test_datastore.yml @@ -1,12 +1,33 @@ name: Unit Tests | DataStore on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: datastore-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSDataStorePlugin diff --git a/.github/workflows/unit_test_geo.yml b/.github/workflows/unit_test_geo.yml index 4a78110b87..137deacd3d 100644 --- a/.github/workflows/unit_test_geo.yml +++ b/.github/workflows/unit_test_geo.yml @@ -1,12 +1,33 @@ name: Unit Tests | Geo on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: geo-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSLocationGeoPlugin diff --git a/.github/workflows/unit_test_internal_pinpoint.yml b/.github/workflows/unit_test_internal_pinpoint.yml index 413c7f8fa3..33aff6b2aa 100644 --- a/.github/workflows/unit_test_internal_pinpoint.yml +++ b/.github/workflows/unit_test_internal_pinpoint.yml @@ -1,12 +1,33 @@ name: Unit Tests | Internal Pinpoint on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: internal-pinpoint-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: InternalAWSPinpointUnitTests diff --git a/.github/workflows/unit_test_logging.yml b/.github/workflows/unit_test_logging.yml index 23697a599f..8da0b1fd8d 100644 --- a/.github/workflows/unit_test_logging.yml +++ b/.github/workflows/unit_test_logging.yml @@ -1,12 +1,33 @@ name: Unit Tests | Logging on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: logging-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSCloudWatchLoggingPlugin diff --git a/.github/workflows/unit_test_predictions.yml b/.github/workflows/unit_test_predictions.yml index 0ea128a720..3d382e65a3 100644 --- a/.github/workflows/unit_test_predictions.yml +++ b/.github/workflows/unit_test_predictions.yml @@ -1,17 +1,38 @@ name: Unit Tests | Predictions on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: predictions-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSPredictionsPlugin coreml-predictions-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: CoreMLPredictionsPlugin diff --git a/.github/workflows/unit_test_push_notifications.yml b/.github/workflows/unit_test_push_notifications.yml index 4e6e26469b..c78bf7f88a 100644 --- a/.github/workflows/unit_test_push_notifications.yml +++ b/.github/workflows/unit_test_push_notifications.yml @@ -1,12 +1,33 @@ name: Unit Tests | Push Notifications on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: push-notifications-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSPinpointPushNotificationsPlugin diff --git a/.github/workflows/unit_test_storage.yml b/.github/workflows/unit_test_storage.yml index d17439e906..21ce464d6e 100644 --- a/.github/workflows/unit_test_storage.yml +++ b/.github/workflows/unit_test_storage.yml @@ -1,12 +1,33 @@ name: Unit Tests | Storage on: workflow_dispatch: + inputs: + ios: + description: '📱 iOS' + required: true + default: true + type: boolean + macos: + description: '💻 macOS' + required: true + default: true + type: boolean + tvos: + description: '📺 tvOS' + required: true + default: true + type: boolean + watchos: + description: '⌚️ watchOS' + required: true + default: true + type: boolean permissions: contents: read jobs: storage-unit-tests: - uses: ./.github/workflows/run_xcodebuild_test_platforms.yml + uses: ./.github/workflows/run_unit_tests_platforms.yml with: scheme: AWSS3StoragePlugin diff --git a/.github/workflows/upload_coverage_report.yml b/.github/workflows/upload_coverage_report.yml index 29a76f6720..287e9fc154 100644 --- a/.github/workflows/upload_coverage_report.yml +++ b/.github/workflows/upload_coverage_report.yml @@ -17,7 +17,7 @@ permissions: jobs: upload-coverage: - name: ${{ inputs.scheme }} Coverage Report + name: Upload Coverage | ${{ inputs.scheme }} timeout-minutes: 2 runs-on: ubuntu-latest steps: diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Amplify-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Amplify-Package.xcscheme index 0da3673ffa..6970be959c 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Amplify-Package.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/Amplify-Package.xcscheme @@ -9,8 +9,8 @@ + + + + + + + + + + + + + + + + @@ -597,16 +653,6 @@ ReferencedContainer = "container:"> - - - - - - - - - - - -