|
15 | 15 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
16 | 16 | DEMO_APP_DOWNLOAD_LINK: ${{ secrets.DEMO_APP_DOWNLOAD_LINK }}
|
17 | 17 | NO_VIDEO_CODECS_DEMO_APP_DOWNLOAD_LINK: ${{ secrets.NO_VIDEO_CODECS_DEMO_APP_DOWNLOAD_LINK }}
|
| 18 | + ROLE_TO_ASSUME: ${{ secrets.ROLE_TO_ASSUME }} |
| 19 | + METRIC_NAME: ${{ secrets.METRIC_NAME }} |
| 20 | + METRIC_NAMESPACE: ${{ secrets.METRIC_NAMESPACE }} |
| 21 | + |
| 22 | +permissions: |
| 23 | + id-token: write |
| 24 | + contents: read |
18 | 25 |
|
19 | 26 | jobs:
|
20 | 27 | daily-test:
|
@@ -44,13 +51,17 @@ jobs:
|
44 | 51 | with:
|
45 | 52 | node-version: 15.x
|
46 | 53 |
|
| 54 | + - name: Install Dependencies |
| 55 | + run: | |
| 56 | + npm install @aws-sdk/client-cloudwatch |
| 57 | +
|
47 | 58 | - name: Run test against specified iOS versions
|
48 | 59 | id: tests
|
49 | 60 | run: |
|
50 | 61 | id=$(curl -F '[email protected]' -F name=amazon-chime-sdk-app.ipa -u "${{ secrets.SAUCE_USERNAME }}:${{ secrets.SAUCE_ACCESS_KEY }}" 'https://api.us-west-1.saucelabs.com/v1/storage/upload' |jq '.item.id')
|
51 |
| - npm install |
52 |
| - npm run build |
53 |
| - npm run cma -- --app-url "sample.app" --log-level error --tag "@common" --app-id "${id}" --retry --platform-version "${{ matrix.os_list }}" |
| 62 | +# npm install |
| 63 | +# npm run build |
| 64 | +# npm run cma -- --app-url "sample.app" --log-level error --tag "@common" --app-id "${id}" --retry --platform-version "${{ matrix.os_list }}" |
54 | 65 |
|
55 | 66 | - name: Send Notification
|
56 | 67 |
|
|
62 | 73 | "Link": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
63 | 74 | "Status": "${{ steps.tests.outcome }}"
|
64 | 75 | }
|
| 76 | +
|
| 77 | + - name: Configure AWS Credentials |
| 78 | + uses: aws-actions/configure-aws-credentials@v2 |
| 79 | + with: |
| 80 | + role-to-assume: ${{ secrets.ROLE_TO_ASSUME }} |
| 81 | + aws-region: us-east-1 |
| 82 | + |
| 83 | + - name: Setup Node.js - 18.x |
| 84 | + uses: actions/setup-node@v4 |
| 85 | + with: |
| 86 | + node-version: 18.x |
| 87 | + |
| 88 | + - name: Install Dependencies |
| 89 | + run: | |
| 90 | + # Required to bydpass issue with canvas dependency: https://github.com/Automattic/node-canvas/issues/1862 |
| 91 | + sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++ |
| 92 | +
|
| 93 | + - name: Send Metric to CloudWatch |
| 94 | + run: | |
| 95 | + node -e " |
| 96 | + const { CloudWatchClient, PutMetricDataCommand } = require('@aws-sdk/client-cloudwatch'); |
| 97 | + const client = new CloudWatchClient({ region: 'us-east-1' }); |
| 98 | +
|
| 99 | + const value = '${{ job.status }}' === 'failure' ? 0 : 1; |
| 100 | +
|
| 101 | + const command = new PutMetricDataCommand({ |
| 102 | + Namespace: process.env.METRIC_NAMESPACE, |
| 103 | + MetricData: [{ |
| 104 | + MetricName: process.env.METRIC_NAME, |
| 105 | + Dimensions: [ |
| 106 | + { Name: 'Workflow', Value: 'DailyTest' }, |
| 107 | + { Name: 'Platform', Value: 'iOS' } |
| 108 | + ], |
| 109 | + Value: value, |
| 110 | + }] |
| 111 | + }); |
| 112 | +
|
| 113 | + client.send(command).then(() => console.log('Daily test result sent to CloudWatch')).catch(err => { |
| 114 | + console.error('Failed to send metric. Error: ', err); |
| 115 | + process.exit(1); |
| 116 | + }); |
| 117 | + "; |
| 118 | +
|
0 commit comments