Skip to content

Commit

Permalink
ci: change to use xcode version with alias
Browse files Browse the repository at this point in the history
  • Loading branch information
5d committed Jan 9, 2024
1 parent eec6a7f commit 1383007
Show file tree
Hide file tree
Showing 29 changed files with 93 additions and 67 deletions.
39 changes: 30 additions & 9 deletions .github/composite_actions/get_platform_parameters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,48 @@ inputs:
required: true
type: string
xcode_version:
description: 'The version of Xcode. Valid values are 14.3 and 15.0'
required: true
description: "The version of Xcode. Available aliases are 'latest' and 'minimum'"
default: 'latest'
type: string
destination:
description: 'The destination for xcode cli'
default: ''
type: string

outputs:
destination:
description: "The destination associated with the given platform and Xcode version"
value: ${{ steps.platform.outputs.destination }}
sdk:
description: "The SDK associated with the given platform"
value: ${{ steps.platform.outputs.sdk }}
xcode-version:
description: "The Xcode version to build with"
value: ${{ steps.platform.outputs.xcode-version }}

runs:
using: "composite"
steps:
- id: platform
run: |
LATEST_XCODE_VERSION=15.1
MINIMUM_XCODE_VERSION=14.3
PLATFORM=${{ inputs.platform }}
case $PLATFORM in
iOS|tvOS|watchOS|macOS) ;;
*) echo "Unsupported platform: $PLATFORM"; exit 1 ;;
esac
XCODE_VERSION=${{ inputs.xcode_version }}
case $XCODE_VERSION in
14.3|15.0) ;;
*) echo "Unsupported Xcode version: $XCODE_VERSION"; exit 1 ;;
case ${{ inputs.xcode_version }} in
latest)
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
minimum)
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
*)
XCODE_VERSION=${{ inputs.xcode_version }} ;;
esac
echo "xcode-version=$XCODE_VERSION" >> $GITHUB_OUTPUT
DESTINATION_MAPPING='{
"14.3": {
Expand All @@ -39,22 +55,27 @@ runs:
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4",
"macOS": "platform=macOS,arch=x86_64"
},
"15.0": {
"15.1": {
"iOS": "platform=iOS Simulator,name=iPhone 15,OS=latest",
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest",
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=latest",
"macOS": "platform=macOS,arch=x86_64"
}
}'
DESTINATION=$(echo $DESTINATION_MAPPING | jq -r .$XCODE_VERSION.$PLATFORM // '${{ inputs.destination }}')
if [ -z "$DESTINATION" ]; then
echo "No available destination to build for"
exit 1
fi
echo "destination=$DESTINATION" >> $GITHUB_OUTPUT
SDK_MAPPING='{
"iOS": "iphonesimulator",
"tvOS": "appletvsimulator",
"watchOS": "watchsimulator",
"macOS": "macosx"
}'
echo "destination=$(echo $DESTINATION_MAPPING | jq -r ."\"$XCODE_VERSION\"".$PLATFORM)" >> $GITHUB_OUTPUT
echo "sdk=$(echo $SDK_MAPPING | jq -r .$PLATFORM)" >> $GITHUB_OUTPUT
shell: bash

3 changes: 1 addition & 2 deletions .github/composite_actions/run_xcodebuild_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ inputs:
required: false
type: string
destination:
required: false
required: true
type: string
default: 'platform=iOS Simulator,name=iPhone 13,OS=latest'
sdk:
required: false
type: string
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_amplify_swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
uses: ./.github/composite_actions/get_platform_parameters
with:
platform: ${{ inputs.platform }}
xcode_version: '14.3'
xcode_version: 'latest'

- name: Attempt to use the dependencies cache
id: dependencies-cache
timeout-minutes: 4
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
scheme: Amplify-Package
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_14.3.app
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.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 }}
Expand All @@ -66,7 +66,7 @@ jobs:
with:
path: ~/Library/Developer/Xcode/DerivedData/Amplify
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:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/integ_test_analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSPinpointAnalyticsPluginIntegrationTestsWatch' || 'AWSPinpointAnalyticsPluginIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/Analytics/Tests/AnalyticsHostApp
xcode_version: '14.3'
resource_subfolder: analytics
timeout-minutes: 30
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginFunctionalTestsWatch' || 'AWSAPIPluginFunctionalTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
scheme: AWSAPIPluginGraphQLAuthDirectiveTests
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_graphql_iam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
scheme: AWSAPIPluginGraphQLIAMTests
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_graphql_lambda_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginGraphQLLambdaAuthTestsWatch' || 'AWSAPIPluginGraphQLLambdaAuthTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_graphql_lazy_load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
scheme: AWSAPIPluginLazyLoadTests
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_graphql_user_pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
scheme: AWSAPIPluginGraphQLUserPoolTests
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_rest_iam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSAPIPluginRESTIAMTestsWatch' || 'AWSAPIPluginRESTIAMTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_api_rest_user_pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
scheme: AWSAPIPluginRESTUserPoolTests
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/API/Tests/APIHostApp
xcode_version: '14.3'
resource_subfolder: api
timeout-minutes: 45
secrets: inherit
2 changes: 0 additions & 2 deletions .github/workflows/integ_test_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AuthIntegrationTestsWatch' || 'AuthIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/Auth/Tests/AuthHostApp/
xcode_version: '14.3'
resource_subfolder: auth
timeout-minutes: 30
secrets: inherit
Expand All @@ -56,7 +55,6 @@ jobs:
scheme: AuthHostedUIApp
platform: iOS
project_path: ./AmplifyPlugins/Auth/Tests/AuthHostedUIApp/
xcode_version: '14.3'
resource_subfolder: auth
timeout-minutes: 30
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_auth_cognito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginAuthCognitoTestsWatch' || 'AWSDataStorePluginAuthCognitoTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_auth_iam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginAuthIAMTestsWatch' || 'AWSDataStorePluginAuthIAMTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginIntegrationTestsWatch' || 'AWSDataStorePluginIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_cpk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginCPKTestsWatch' || 'AWSDataStorePluginCPKTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_lazy_load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginLazyLoadTestsWatch' || 'AWSDataStorePluginLazyLoadTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_multi_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginMultiAuthTestsWatch' || 'AWSDataStorePluginMultiAuthTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_datastore_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSDataStorePluginV2TestsWatch' || 'AWSDataStorePluginV2Tests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/DataStore/Tests/DataStoreHostApp
xcode_version: '14.3'
resource_subfolder: datastore
timeout-minutes: 120
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_geo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSLocationGeoPluginIntegrationTestsWatch' || 'AWSLocationGeoPluginIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/Geo/Tests/GeoHostApp/
xcode_version: '14.3'
resource_subfolder: geo
timeout-minutes: 30
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSCloudWatchLoggingPluginIntegrationTestsWatch' || 'AWSCloudWatchLoggingPluginIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/Logging/Tests/AWSCloudWatchLoggingPluginHostApp
xcode_version: ${{ matrix.platform == 'watchOS' && '15.0' || '14.3' }}
resource_subfolder: logging
timeout-minutes: 60
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/integ_test_predictions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSPredictionsPluginIntegrationTestsWatch' || 'AWSPredictionsPluginIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/Predictions/Tests/PredictionsHostApp
xcode_version: '14.3'
resource_subfolder: predictions
timeout-minutes: 30
secrets: inherit
9 changes: 4 additions & 5 deletions .github/workflows/integ_test_push_notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false

- name: Get build parameters for ${{ matrix.platform}}
id: platform
uses: ./.github/composite_actions/get_platform_parameters
with:
platform: ${{ matrix.platform }}
xcode_version: '14.3'


- name: Create the test configuration directory
run: mkdir -p ~/.aws-amplify/amplify-ios/testconfiguration/

Expand Down Expand Up @@ -102,7 +101,7 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'PushNotificationWatchTests' || 'PushNotificationHostApp' }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_14.3.app
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
project_path: ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp
generate_coverage: false
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand All @@ -117,7 +116,7 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'PushNotificationWatchTests' || 'PushNotificationHostApp' }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_14.3.app
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
project_path: ./AmplifyPlugins/Notifications/Push/Tests/PushNotificationHostApp
generate_coverage: false
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/integ_test_storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
scheme: ${{ matrix.platform == 'watchOS' && 'AWSS3StoragePluginIntegrationTestsWatch' || 'AWSS3StoragePluginIntegrationTests' }}
platform: ${{ matrix.platform }}
project_path: ./AmplifyPlugins/Storage/Tests/StorageHostApp/
xcode_version: '14.3'
resource_subfolder: storage
timeout-minutes: 30
secrets: inherit
11 changes: 7 additions & 4 deletions .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Run tests for the given parameters
on:
workflow_call:
inputs:
os-runner:
type: string
default: 'macos-13'
scheme:
description: 'The scheme to run the tests'
required: true
Expand All @@ -15,7 +18,7 @@ on:
type: string
xcode_version:
description: 'The verion of Xcode used to run these tests'
required: true
default: 'latest'
type: string
resource_subfolder:
required: true
Expand All @@ -33,7 +36,7 @@ permissions:
jobs:
integration-tests:
name: ${{ inputs.platform }} Tests | ${{ inputs.scheme }}
runs-on: macos-13
runs-on: ${{ inputs.os-runner }}
if: inputs.platform != 'macOS' # macOS is not supported for Integration Tests
timeout-minutes: ${{ inputs.timeout-minutes }}
environment: IntegrationTest
Expand Down Expand Up @@ -90,7 +93,7 @@ jobs:
scheme: ${{ inputs.scheme }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_${{ inputs.xcode_version }}.app
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
project_path: ${{ inputs.project_path }}
generate_coverage: false
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand All @@ -107,7 +110,7 @@ jobs:
scheme: ${{ inputs.scheme }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_${{ inputs.xcode_version }}.app
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
project_path: ${{ inputs.project_path }}
generate_coverage: false
cloned_source_packages_path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand Down
Loading

0 comments on commit 1383007

Please sign in to comment.