18
18
ROLE_TO_ASSUME : ${{ secrets.ROLE_TO_ASSUME }}
19
19
METRIC_NAME : ${{ secrets.METRIC_NAME }}
20
20
METRIC_NAMESPACE : ${{ secrets.METRIC_NAMESPACE }}
21
-
21
+ REGION : us-east-1
22
22
23
23
permissions :
24
24
id-token : write
32
32
matrix :
33
33
# Latest 2 Android versions. TODO: Upgrade to Appium 2 for OS 14 and above.
34
34
os_list : ["12", "13"]
35
- demo_download_url_list : ["$DEMO_APP_DOWNLOAD_LINK ", "$DEMO_APP_DOWNLOAD_LINK_NO_VIDEO_CODECS "]
35
+ demo_flavor_list : ["default ", "no-video-codecs "]
36
36
outputs :
37
37
job-status : ${{ job.status }}
38
38
46
46
47
47
- name : Get latest prod demo app
48
48
run : |
49
- wget -O amazon-chime-sdk-app.apk ${{ matrix.demo_download_url_list }}
49
+ if [ "${{ matrix.demo_flavor_list }}" = "default" ]; then
50
+ wget -O amazon-chime-sdk-app.apk $DEMO_APP_DOWNLOAD_LINK;
51
+ elif [ "${{ matrix.demo_flavor_list }}" = "no-video-codecs" ]; then
52
+ wget -O amazon-chime-sdk-app.apk $DEMO_APP_DOWNLOAD_LINK_NO_VIDEO_CODECS;
53
+ else
54
+ echo "Error: Unsupported demo app flavor: ${{ matrix.demo_flavor_list }}";
55
+ exit 1;
56
+ fi
50
57
51
58
- name : Setup Node.js - 15.x
52
59
uses : actions/setup-node@v4
@@ -78,25 +85,29 @@ jobs:
78
85
79
86
- name : Configure AWS Credentials
80
87
uses : aws-actions/configure-aws-credentials@v2
88
+ if : always()
81
89
with :
82
90
role-to-assume : ${{ secrets.ROLE_TO_ASSUME }}
83
- aws-region : us-east-1
91
+ aws-region : ${{ env.REGION }}
84
92
85
93
- name : Setup Node.js - 18.x
86
94
uses : actions/setup-node@v4
95
+ if : always()
87
96
with :
88
97
node-version : 18.x
89
98
90
99
- name : Install Dependencies
100
+ if : always()
91
101
run : |
92
102
# Required to bydpass issue with canvas dependency: https://github.com/Automattic/node-canvas/issues/1862
93
103
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
94
104
95
105
- name : Send Metric to CloudWatch
106
+ if : always()
96
107
run : |
97
108
node -e "
98
109
const { CloudWatchClient, PutMetricDataCommand } = require('@aws-sdk/client-cloudwatch');
99
- const client = new CloudWatchClient({ region: 'us-east-1' });
110
+ const client = new CloudWatchClient({ region: process.env.REGION });
100
111
101
112
const value = '${{ job.status }}' === 'failure' ? 0 : 1;
102
113
@@ -105,8 +116,9 @@ jobs:
105
116
MetricData: [{
106
117
MetricName: process.env.METRIC_NAME,
107
118
Dimensions: [
108
- { Name: 'Workflow', Value: 'DailyTest' },
109
- { Name: 'Platform', Value: 'Android' }
119
+ { Name: 'Platform', Value: 'Android' },
120
+ { Name: 'OS', Value: ${{ matrix.os_list }} },
121
+ { Name: 'Flavor', Value: ${{ matrix.flavor }} }
110
122
],
111
123
Value: value,
112
124
}]
0 commit comments