Skip to content

Commit

Permalink
chore: Control coverage through repository variable [skip ci] (#3656)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisebas authored Apr 30, 2024
1 parent d03f5a6 commit 6e2a881
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main'}}

jobs:
unit-tests-without-coverage:
targets-without-coverage:
name: ${{ matrix.scheme }} Unit Tests
strategy:
fail-fast: false
Expand All @@ -54,7 +54,7 @@ jobs:
scheme: ${{ matrix.scheme }}
generate_coverage_report: false

unit-tests-with-coverage:
targets-with-coverage:
name: ${{ matrix.scheme }} Unit Tests
strategy:
fail-fast: false
Expand All @@ -76,40 +76,41 @@ jobs:
uses: ./.github/workflows/run_unit_tests_platforms.yml
with:
scheme: ${{ matrix.scheme }}
generate_coverage_report: true
generate_coverage_report: ${{ vars.DISABLE_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:
if: ${{ vars.DISABLE_COVERAGE_REPORT != 'true' }}
name: ${{ matrix.file.scheme }} Unit Tests
needs: [targets-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
name: Confirm Passing Unit Tests
if: ${{ !cancelled() }}
needs: [
unit-tests-with-coverage,
unit-tests-without-coverage
targets-with-coverage,
targets-without-coverage
]
env:
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
Expand Down

0 comments on commit 6e2a881

Please sign in to comment.