Skip to content

Commit

Permalink
Add no video codec flavor of demo app to daily tests (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylonChime committed Jan 14, 2025
1 parent e70eac3 commit 7d5dc59
Showing 1 changed file with 73 additions and 23 deletions.
96 changes: 73 additions & 23 deletions .github/workflows/daily-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@ name: Daily Test
on:
schedule:
# More information on cron https://crontab.guru/
# GitHub actions is using UTC time. Scheduling action at 4 am PST
- cron: '0 12 * * *'
# GitHub actions is using UTC time. Scheduling action at 3 am PST
- cron: '0 11 * * *'

workflow_dispatch:

# note secrets can only be referenced in env or run
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
DEMO_APP_DOWNLOAD_LINK: ${{ secrets.DEMO_APP_DOWNLOAD_LINK }}
DEMO_APP_DOWNLOAD_LINK_NO_VIDEO_CODECS: ${{ secrets.DEMO_APP_DOWNLOAD_LINK_NO_VIDEO_CODECS }}

permissions:
id-token: write
contents: read

jobs:
daily-test:
name: Amazon Chime Android SDK Daily Test
runs-on: ubuntu-latest
strategy:
matrix:
# Latest 2 Android versions. TODO: Upgrade to Appium 2 for OS 14 and above.
os_list: ["12", "13"]
demo_download_url_list: ["$DEMO_APP_DOWNLOAD_LINK", "$DEMO_APP_DOWNLOAD_LINK_NO_VIDEO_CODECS"]
outputs:
job-status: ${{ job.status }}

Expand All @@ -30,31 +42,69 @@ jobs:

- name: Get latest prod demo app
run: |
wget -O amazon-chime-sdk-app.apk ${{ secrets.DEMO_APP_DOWNLOAD_LINK }}
wget -O amazon-chime-sdk-app.apk ${{ matrix.demo_download_url_list }}
- name: Setup Node.js - 15.x
- name: Setup Node.js - 18.x
uses: actions/setup-node@v4
with:
node-version: 15.x
node-version: 18.x

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
npm install @aws-sdk/client-cloudwatch
- name: Run tests against the latest 2 Android versions
- name: Run tests against specified Android versions
id: tests
run: |
id=$(curl -F '[email protected]' -F name=amazon-chime-sdk-app.apk -u "${{ secrets.SAUCE_USERNAME }}:${{ secrets.SAUCE_ACCESS_KEY }}" 'https://api.us-west-1.saucelabs.com/v1/storage/upload' |jq '.item.id')
npm install
npm run build
for os in 12 13; do
npm run cma -- --app-url "sample.apk" --log-level error --tag "@common" --app-id "${id}" --retry --platform-version $os
sleep 10
done
- name: Send Notification
uses: slackapi/[email protected]
if: failure()
with:
payload: |
{
"Platform": "Android",
"Link": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"Status": "${{ steps.tests.outcome }}"
}
# npm install
# npm run build
# npm run cma -- --app-url "sample.apk" --log-level error --tag "@common" --app-id "${id}" --retry --platform-version ${{ matrix.os_list }}

# - name: Send Notification
# uses: slackapi/[email protected]
# if: failure()
# with:
# payload: |
# {
# "Platform": "Android",
# "Link": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
# "Status": "${{ steps.tests.outcome }}"
# }
- name: Debug OIDC Token
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ secrets.ACTIONS_ID_TOKEN_REQUEST_URL }}
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ secrets.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}
run: |
echo "OIDC Token URL: $ACTIONS_ID_TOKEN_REQUEST_URL"
curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL"
- name: Send Metric to CloudWatch
run: |
node -e "
const { CloudWatchClient, PutMetricDataCommand } = require('@aws-sdk/client-cloudwatch');
const client = new CloudWatchClient({ region: 'us-east-1' });
const value = '${{ job.status }}' === 'failure' ? 0 : 1;
const command = new PutMetricDataCommand({
Namespace: 'ChimeMobileSDKTests',
MetricData: [{
MetricName: 'MobileSDKDailyTestMetric',
Dimensions: [
{ Name: 'Workflow', Value: 'DailyTest' },
{ Name: 'Platform', Value: 'Android' }
],
Value: value,
Timestamp: new Date().toISOString()
}]
});
client.send(command).then(() => console.log('Daily test result sent to CloudWatch')).catch(err => {
console.error('Failed to send metric. Error: ', err);
process.exit(1);
});
";

0 comments on commit 7d5dc59

Please sign in to comment.