Skip to content

Commit

Permalink
chore: kickoff release
Browse files Browse the repository at this point in the history
  • Loading branch information
lawmicha authored Apr 29, 2024
2 parents da563be + a3e267e commit b47ec3e
Show file tree
Hide file tree
Showing 69 changed files with 3,574 additions and 250 deletions.
17 changes: 12 additions & 5 deletions .github/composite_actions/get_platform_parameters/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,22 @@ runs:
- id: get-xcode-version
run: |
LATEST_XCODE_VERSION=14.3.1
MINIMUM_XCODE_VERSION=14.0.1
MINIMUM_XCODE_VERSION_IOS_MAC=14.1.0
MINIMUM_XCODE_VERSION_WATCH_TV=14.3.1
INPUT_XCODE_VERSION=${{ inputs.xcode_version }}
case $INPUT_XCODE_VERSION in
latest)
XCODE_VERSION=$LATEST_XCODE_VERSION ;;
minimum)
XCODE_VERSION=$MINIMUM_XCODE_VERSION ;;
INPUT_PLATFORM=${{ inputs.platform }}
case $INPUT_PLATFORM in
iOS|macOS)
XCODE_VERSION=$MINIMUM_XCODE_VERSION_IOS_MAC ;;
tvOS|watchOS)
XCODE_VERSION=$MINIMUM_XCODE_VERSION_WATCH_TV ;;
esac ;;
*)
XCODE_VERSION=$INPUT_XCODE_VERSION ;;
esac
Expand All @@ -63,9 +70,9 @@ runs:
DESTINATION_MAPPING='{
"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",
"iOS": "platform=iOS Simulator,name=iPhone 14,OS=16.1",
"tvOS": "platform=tvOS Simulator,name=Apple TV 4K (2nd generation),OS=16.1",
"watchOS": "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=9.1",
"macOS": "platform=macOS,arch=x86_64"
},
"latest": {
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_amplify_swift_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ jobs:
- 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
uses: ./.github/workflows/build_scheme.yml
with:
scheme: Amplify-Package
platform: ${{ matrix.platform }}

confirm-pass:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/build_minimum_supported_swift_platforms.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Build with Minimum Supported Xcode Versions
name: Build with minimum Xcode version | Amplify Swift
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read
actions: write

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main'}}

jobs:
build-amplify-with-minimum-supported-xcode:
name: Build Amplify Swift for ${{ matrix.platform }}
Expand All @@ -14,12 +24,13 @@ jobs:
matrix:
platform: [iOS, macOS, tvOS, watchOS]

uses: ./.github/workflows/build_amplify_swift.yml
uses: ./.github/workflows/build_scheme.yml
with:
os-runner: macos-12
scheme: Amplify-Build
os-runner: ${{ (matrix.platform == 'tvOS' || matrix.platform == 'watchOS') && 'macos-13' || 'macos-12' }}
xcode-version: 'minimum'
platform: ${{ matrix.platform }}
cacheable: false
save_build_cache: false

confirm-pass:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Build Amplify-Package for the given platform
name: Build scheme for the given platform and other parameters
on:
workflow_call:
inputs:
scheme:
type: string
required: true

platform:
type: string
required: true
Expand All @@ -14,7 +18,7 @@ on:
type: string
default: 'macos-13'

cacheable:
save_build_cache:
type: boolean
default: true

Expand All @@ -23,8 +27,8 @@ permissions:
actions: write

jobs:
build-amplify-swift:
name: Build Amplify-Package | ${{ inputs.platform }}
build-scheme:
name: Build ${{ inputs.scheme }} | ${{ inputs.platform }}
runs-on: ${{ inputs.os-runner }}
steps:
- name: Checkout repository
Expand All @@ -41,9 +45,8 @@ jobs:

- name: Attempt to use the dependencies cache
id: dependencies-cache
if: inputs.cacheable
timeout-minutes: 4
continue-on-error: ${{ inputs.cacheable }}
continue-on-error: true
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/Library/Developer/Xcode/DerivedData/Amplify
Expand All @@ -53,20 +56,18 @@ jobs:
- name: Attempt to restore the build cache from main
id: build-cache
if: inputs.cacheable
timeout-minutes: 4
continue-on-error: ${{ inputs.cacheable }}
continue-on-error: true
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
key: Amplify-${{ inputs.platform }}-build-cache

- name: Build Amplify for Swift
- name: Build ${{ inputs.scheme }}
id: build-package
continue-on-error: ${{ inputs.cacheable }}
uses: ./.github/composite_actions/run_xcodebuild
with:
scheme: Amplify-Package
scheme: ${{ inputs.scheme }}
destination: ${{ steps.platform.outputs.destination }}
sdk: ${{ steps.platform.outputs.sdk }}
xcode_path: /Applications/Xcode_${{ steps.platform.outputs.xcode-version }}.app
Expand All @@ -75,22 +76,22 @@ jobs:
disable_package_resolution: ${{ steps.dependencies-cache.outputs.cache-hit }}

- name: Save the dependencies cache in main
if: inputs.cacheable && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
if: inputs.save_build_cache && 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.dependencies-cache.outputs.cache-primary-key }}

- name: Delete the old build cache
if: inputs.cacheable && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
if: inputs.save_build_cache && steps.build-cache.outputs.cache-hit && github.ref_name == 'main'
env:
GH_TOKEN: ${{ github.token }}
continue-on-error: ${{ inputs.cacheable }}
continue-on-error: true
run: |
gh cache delete ${{ steps.build-cache.outputs.cache-primary-key }}
- name: Save the build cache
if: inputs.cacheable && github.ref_name == 'main'
if: inputs.save_build_cache && github.ref_name == 'main'
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ${{ github.workspace }}/Build
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,30 @@ jobs:
scheme: ${{ matrix.scheme }}
generate_coverage_report: true

report-coverage:
name: ${{ matrix.file.scheme }} Unit Tests
needs: [unit-tests-with-coverage]
strategy:
fail-fast: false
matrix:
file: [
{ scheme: Amplify, flags: 'Amplify,unit_tests' },
{ scheme: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' },
{ scheme: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' },
{ scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' },
{ scheme: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' },
{ scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' },
{ scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' },
{ scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
{ scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
{ scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' },
{ scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' },
{ scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' }
]
uses: ./.github/workflows/upload_coverage_report.yml
with:
scheme: ${{ matrix.file.scheme }}
flags: ${{ matrix.file.flags }}
# report-coverage:
# name: ${{ matrix.file.scheme }} Unit Tests
# needs: [unit-tests-with-coverage]
# strategy:
# fail-fast: false
# matrix:
# file: [
# { scheme: Amplify, flags: 'Amplify,unit_tests' },
# { scheme: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' },
# { scheme: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' },
# { scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' },
# { scheme: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' },
# { scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' },
# { scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' },
# { scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
# { scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
# { scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' },
# { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' },
# { scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' }
# ]
# uses: ./.github/workflows/upload_coverage_report.yml
# with:
# scheme: ${{ matrix.file.scheme }}
# flags: ${{ matrix.file.flags }}

unit-test-pass-confirmation:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit b47ec3e

Please sign in to comment.