Skip to content

chore: Building per platform and running tests without building #4

chore: Building per platform and running tests without building

chore: Building per platform and running tests without building #4

name: Build and Test the Amplify Package
on:
- push
permissions:
contents: read
actions: write
jobs:
build-amplify-swift-iOS:
name: Build for iOS
uses: ./.github/workflows/build_amplify_swift_for_testing.yml
with:
platform: iOS
build-amplify-swift-macOS:
name: Build for macOS
uses: ./.github/workflows/build_amplify_swift_for_testing.yml
with:
platform: macOS
build-amplify-swift-tvOS:
name: Build for tvOS
uses: ./.github/workflows/build_amplify_swift_for_testing.yml
with:
platform: tvOS
build-amplify-swift-watchOS:
name: Build for watchOS
uses: ./.github/workflows/build_amplify_swift_for_testing.yml
with:
platform: watchOS
run-unit-tests-iOS:
name: ${{ matrix.scheme }} Unit Tests
needs: [build-amplify-swift-iOS]
strategy:
fail-fast: false
matrix:
scheme: [
Amplify,
AWSPluginsCore,
AWSAPIPlugin,
AWSCloudWatchLoggingPlugin,
AWSCognitoAuthPlugin,
AWSDataStorePlugin,
AWSLocationGeoPlugin,
AWSPredictionsPlugin,
AWSPinpointAnalyticsPlugin,
AWSPinpointPushNotificationsPlugin,
AWSS3StoragePlugin,
CoreMLPredictionsPlugin,
InternalAWSPinpointUnitTests
]
uses: ./.github/workflows/run_unit_tests.yml
with:
scheme: ${{ matrix.scheme }}
platform: iOS
xcode_version: '14.3'
generate_coverage_report: ${{ matrix.scheme != 'InternalAWSPinpointUnitTests' }}
build_cache_key: Amplify-iOS-cache-${{ github.ref_name }}
test_without_building: true
delete_build_cache_on_success: ${{ github.ref_name != 'main'}}
run-unit-tests-macOS:
name: ${{ matrix.scheme }} Unit Tests
needs: [build-amplify-swift-macOS]
strategy:
fail-fast: false
matrix:
scheme: [
Amplify,
AWSPluginsCore,
AWSAPIPlugin,
AWSCloudWatchLoggingPlugin,
AWSCognitoAuthPlugin,
AWSDataStorePlugin,
AWSLocationGeoPlugin,
AWSPredictionsPlugin,
AWSPinpointAnalyticsPlugin,
AWSPinpointPushNotificationsPlugin,
AWSS3StoragePlugin,
CoreMLPredictionsPlugin,
InternalAWSPinpointUnitTests
]
uses: ./.github/workflows/run_unit_tests.yml
with:
scheme: ${{ matrix.scheme }}
platform: macOS
xcode_version: '14.3'
generate_coverage_report: false
build_cache_key: Amplify-macOS-cache-${{ github.ref_name }}
test_without_building: true
delete_build_cache_on_success: ${{ github.ref_name != 'main'}}
run-unit-tests-tvOS:
name: ${{ matrix.scheme }} Unit Tests
needs: [build-amplify-swift-tvOS]
strategy:
fail-fast: false
matrix:
scheme: [
Amplify,
AWSPluginsCore,
AWSAPIPlugin,
AWSCloudWatchLoggingPlugin,
AWSCognitoAuthPlugin,
AWSDataStorePlugin,
AWSLocationGeoPlugin,
AWSPredictionsPlugin,
AWSPinpointAnalyticsPlugin,
AWSPinpointPushNotificationsPlugin,
AWSS3StoragePlugin,
CoreMLPredictionsPlugin,
InternalAWSPinpointUnitTests
]
uses: ./.github/workflows/run_unit_tests.yml
with:
scheme: ${{ matrix.scheme }}
platform: tvOS
xcode_version: '14.3'
generate_coverage_report: false
build_cache_key: Amplify-macOS-cache-${{ github.ref_name }}
test_without_building: true
delete_build_cache_on_success: ${{ github.ref_name != 'main'}}
run-unit-tests-watchOS:
name: ${{ matrix.scheme }} Unit Tests
needs: [build-amplify-swift-watchOS]
strategy:
fail-fast: false
matrix:
scheme: [
Amplify,
AWSPluginsCore,
AWSAPIPlugin,
AWSCloudWatchLoggingPlugin,
AWSCognitoAuthPlugin,
AWSDataStorePlugin,
AWSLocationGeoPlugin,
AWSPredictionsPlugin,
AWSPinpointAnalyticsPlugin,
AWSPinpointPushNotificationsPlugin,
AWSS3StoragePlugin,
CoreMLPredictionsPlugin,
InternalAWSPinpointUnitTests
]
uses: ./.github/workflows/run_unit_tests.yml
with:
scheme: ${{ matrix.scheme }}
platform: watchOS
xcode_version: '14.3'
generate_coverage_report: false
build_cache_key: Amplify-watchOS-cache-${{ github.ref_name }}
test_without_building: true
delete_build_cache_on_success: ${{ github.ref_name != 'main'}}
report-coverage:
name: ${{ matrix.file.scheme }} Coverage Report
needs: [run-unit-tests-iOS]
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
name: Confirm Passing Unit Tests
if: ${{ !cancelled() }}
needs: [
run-unit-tests-iOS,
run-unit-tests-macOS,
run-unit-tests-tvOS,
run-unit-tests-watchOS
]
env:
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
steps:
- run: exit $EXIT_CODE