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 11, 2024
1 parent 0d8f12a commit 6b8a60d
Show file tree
Hide file tree
Showing 30 changed files with 134 additions and 101 deletions.
83 changes: 60 additions & 23 deletions .github/composite_actions/get_platform_parameters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,99 @@ 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 associated with the given platform and Xcode version"
default: ''
type: string

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

runs:
using: "composite"
steps:
- id: platform
- name: Validate platform
run: |
PLATFORM=${{ inputs.platform }}
case $PLATFORM in
INPUT_PLATFORM=${{ inputs.platform }}
case $INPUT_PLATFORM in
iOS|tvOS|watchOS|macOS) ;;
*) echo "Unsupported platform: $PLATFORM"; exit 1 ;;
*) echo "Unsupported platform: $INPUT_PLATFORM"; exit 1 ;;
esac
shell: bash

- id: get-xcode-version
run: |
LATEST_XCODE_VERSION=14.3.1
MINIMUM_XCODE_VERSION=14.0.1
XCODE_VERSION=${{ inputs.xcode_version }}
case $XCODE_VERSION in
14.0.1|14.3|15.0) ;;
*) echo "Unsupported Xcode version: $XCODE_VERSION"; exit 1 ;;
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
case $INPUT_XCODE_VERSION in
latest)
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
minimum)
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
*)
XCODE_VERSION=$INPUT_XCODE_VERSION ;;
esac
echo "xcode-version=$XCODE_VERSION" >> $GITHUB_OUTPUT
shell: bash

- id: get-destination
run: |
INPUT_PLATFORM=${{ inputs.platform }}
INPUT_DESTINATION='${{ inputs.destination }}'
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
DESTINATION_MAPPING='{
"14.0.1": {
"minimum": {
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.0",
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.0",
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.0",
"macOS": "platform=macOS,arch=x86_64"
},
"14.3": {
"latest": {
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.4",
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=16.4",
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.4",
"macOS": "platform=macOS,arch=x86_64"
},
"15.0": {
"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"
}
}'
if [ -z "$INPUT_DESTINATION" ]; then
DESTINATION=$(echo $DESTINATION_MAPPING | jq -r ".\"$INPUT_XCODE_VERSION\".$INPUT_PLATFORM")
else
DESTINATION=$INPUT_DESTINATION
fi
if [ -z "$DESTINATION" ]; then
echo "No available destination to build for"
exit 1
fi
echo "destination=$DESTINATION" >> $GITHUB_OUTPUT
shell: bash

- id: get-sdk
run: |
INPUT_PLATFORM=${{ inputs.platform }}
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
echo "sdk=$(echo $SDK_MAPPING | jq -r .$INPUT_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
12 changes: 6 additions & 6 deletions .github/workflows/build_amplify_swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

xcode-version:
type: string
default: '14.3'
default: 'latest'

os-runner:
type: string
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
id: dependencies-cache
if: inputs.cacheable
timeout-minutes: 4
continue-on-error: true
continue-on-error: ${{ inputs.cacheable }}
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand All @@ -55,21 +55,21 @@ jobs:
id: build-cache
if: inputs.cacheable
timeout-minutes: 4
continue-on-error: true
continue-on-error: ${{ inputs.cacheable }}
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
key: Amplify-${{ inputs.platform }}-build-cache

- name: Build Amplify for Swift
id: build-package
continue-on-error: true
continue-on-error: ${{ inputs.cacheable }}
uses: ./.github/composite_actions/run_xcodebuild
with:
scheme: Amplify-Package
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
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 @@ -85,7 +85,7 @@ jobs:
if: inputs.cacheable && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: true
continue-on-error: ${{ inputs.cacheable }}
run: |
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/build_minimum_supported_swift_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,12 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- os-runner: macos-12
xcode-version: 14.0.1
platform: iOS

- os-runner: macos-12
xcode-version: 14.0.1
platform: macOS

- os-runner: macos-12
xcode-version: 14.0.1
platform: tvOS

- os-runner: macos-12
xcode-version: 14.0.1
platform: watchOS
platform: [iOS, macOS, tvOS, watchOS]

uses: ./.github/workflows/build_amplify_swift.yml
with:
os-runner: ${{ matrix.os-runner }}
xcode-version: ${{ matrix.xcode-version }}
os-runner: macos-12
xcode-version: 'minimum'
platform: ${{ matrix.platform }}
cacheable: false

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
3 changes: 2 additions & 1 deletion .github/workflows/integ_test_logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ 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
xcode_version: ${{ matrix.platform == 'watchOS' && '15.0' || 'latest' }}
destination: ${{ matrix.platform == 'watchOS' && 'platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=10.2' || '' }}
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
Loading

0 comments on commit 6b8a60d

Please sign in to comment.