Skip to content

Commit 6e2a881

Browse files
authored
chore: Control coverage through repository variable [skip ci] (#3656)
1 parent d03f5a6 commit 6e2a881

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

.github/workflows/unit_test.yml

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ concurrency:
4141
cancel-in-progress: ${{ github.ref_name != 'main'}}
4242

4343
jobs:
44-
unit-tests-without-coverage:
44+
targets-without-coverage:
4545
name: ${{ matrix.scheme }} Unit Tests
4646
strategy:
4747
fail-fast: false
@@ -54,7 +54,7 @@ jobs:
5454
scheme: ${{ matrix.scheme }}
5555
generate_coverage_report: false
5656

57-
unit-tests-with-coverage:
57+
targets-with-coverage:
5858
name: ${{ matrix.scheme }} Unit Tests
5959
strategy:
6060
fail-fast: false
@@ -76,40 +76,41 @@ jobs:
7676
uses: ./.github/workflows/run_unit_tests_platforms.yml
7777
with:
7878
scheme: ${{ matrix.scheme }}
79-
generate_coverage_report: true
79+
generate_coverage_report: ${{ vars.DISABLE_COVERAGE_REPORT != 'true' }}
8080

81-
# report-coverage:
82-
# name: ${{ matrix.file.scheme }} Unit Tests
83-
# needs: [unit-tests-with-coverage]
84-
# strategy:
85-
# fail-fast: false
86-
# matrix:
87-
# file: [
88-
# { scheme: Amplify, flags: 'Amplify,unit_tests' },
89-
# { scheme: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' },
90-
# { scheme: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' },
91-
# { scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' },
92-
# { scheme: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' },
93-
# { scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' },
94-
# { scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' },
95-
# { scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
96-
# { scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
97-
# { scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' },
98-
# { scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' },
99-
# { scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' }
100-
# ]
101-
# uses: ./.github/workflows/upload_coverage_report.yml
102-
# with:
103-
# scheme: ${{ matrix.file.scheme }}
104-
# flags: ${{ matrix.file.flags }}
81+
report-coverage:
82+
if: ${{ vars.DISABLE_COVERAGE_REPORT != 'true' }}
83+
name: ${{ matrix.file.scheme }} Unit Tests
84+
needs: [targets-with-coverage]
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
file: [
89+
{ scheme: Amplify, flags: 'Amplify,unit_tests' },
90+
{ scheme: AWSPluginsCore, flags: 'AWSPluginsCore,unit_tests' },
91+
{ scheme: AWSAPIPlugin, flags: 'API_plugin_unit_test,unit_tests' },
92+
{ scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' },
93+
{ scheme: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' },
94+
{ scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' },
95+
{ scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' },
96+
{ scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
97+
{ scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
98+
{ scheme: AWSPinpointPushNotificationsPlugin, flags: 'PushNotifications_plugin_unit_test,unit_tests' },
99+
{ scheme: AWSS3StoragePlugin, flags: 'Storage_plugin_unit_test,unit_tests' },
100+
{ scheme: CoreMLPredictionsPlugin, flags: 'CoreMLPredictions_plugin_unit_test,unit_tests' }
101+
]
102+
uses: ./.github/workflows/upload_coverage_report.yml
103+
with:
104+
scheme: ${{ matrix.file.scheme }}
105+
flags: ${{ matrix.file.flags }}
105106

106107
unit-test-pass-confirmation:
107108
runs-on: ubuntu-latest
108109
name: Confirm Passing Unit Tests
109110
if: ${{ !cancelled() }}
110111
needs: [
111-
unit-tests-with-coverage,
112-
unit-tests-without-coverage
112+
targets-with-coverage,
113+
targets-without-coverage
113114
]
114115
env:
115116
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}

0 commit comments

Comments
 (0)