-
Notifications
You must be signed in to change notification settings - Fork 236
133 lines (125 loc) · 4.22 KB
/
Copy pathunit_test.yml
File metadata and controls
133 lines (125 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Unit Tests | All
on:
workflow_call:
inputs:
identifier:
required: true
type: string
workflow_dispatch:
inputs:
ios:
description: '📱 iOS'
required: true
default: true
type: boolean
macos:
description: '💻 macOS'
required: true
default: true
type: boolean
tvos:
description: '📺 tvOS'
required: true
default: true
type: boolean
watchos:
description: '⌚️ watchOS'
required: true
default: true
type: boolean
visionos:
description: 'ᯅ visionOS'
required: true
default: true
type: boolean
push:
branches-ignore:
- main
- release
permissions:
contents: read
concurrency:
group: ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main'}}
jobs:
targets-without-coverage:
name: ${{ matrix.scheme }} Unit Tests
strategy:
fail-fast: false
matrix:
scheme: [
InternalAWSPinpointUnitTests
]
uses: ./.github/workflows/run_unit_tests_platforms.yml
with:
scheme: ${{ matrix.scheme }}
generate_coverage_report: false
targets-with-coverage:
name: ${{ matrix.scheme }} Unit Tests
strategy:
fail-fast: false
matrix:
scheme: [
Amplify,
AWSPluginsCore,
AWSAPIPlugin,
AWSCloudWatchLoggingPlugin,
AWSCognitoAuthPlugin,
AWSDataStorePlugin,
AmplifyRecordCache,
AmplifyKinesisClient,
AmplifyFirehoseClient,
AWSLocationGeoPlugin,
AWSPredictionsPlugin,
AWSPinpointAnalyticsPlugin,
AWSPinpointPushNotificationsPlugin,
AWSS3StoragePlugin,
AmplifyFoundation,
AmplifyFoundationBridge
]
uses: ./.github/workflows/run_unit_tests_platforms.yml
with:
scheme: ${{ matrix.scheme }}
generate_coverage_report: ${{ vars.DISABLE_COVERAGE_REPORT != 'true' }}
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: AmplifyRecordCache, flags: 'RecordCache_unit_test,unit_tests' },
{ scheme: AmplifyKinesisClient, flags: 'Kinesis_plugin_unit_test,unit_tests' },
{ scheme: AmplifyFirehoseClient, flags: 'Firehose_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: AmplifyFoundation, flags: 'Amplify_Foundation_unit_test,unit_tests' },
{ scheme: AmplifyFoundationBridge, flags: 'Amplify_Foundation_Bridge_unit_test,unit_tests' }
]
uses: ./.github/workflows/upload_coverage_report.yml
with:
scheme: ${{ matrix.file.scheme }}
flags: ${{ matrix.file.flags }}
secrets: inherit
unit-test-pass-confirmation:
runs-on: ubuntu-latest
name: Confirm Passing Unit Tests
if: ${{ !cancelled() }}
needs: [
targets-with-coverage,
targets-without-coverage
]
env:
EXIT_CODE: ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
steps:
- run: exit $EXIT_CODE