Do not pass custom video file if not needed #1843
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Browser Compatibility Test | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| CLOUD_WATCH_METRIC: false | |
| TEST_TYPE: Browser-Compatibility-Test | |
| SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}} | |
| SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}} | |
| TEST_URL: ${{secrets.TEST_URL}} | |
| MESSAGING_USER_ARN: ${{secrets.MESSAGING_USER_ARN}} | |
| SLACK_JS_SDK_DEV_CORE_WEBHOOK: ${{secrets.SLACK_JS_SDK_DEV_CORE_WEBHOOK}} | |
| PRE_RUN_SCRIPT_URL: ${{secrets.PRE_RUN_SCRIPT_URL}} | |
| METRIC_NAME: ${{ secrets.METRIC_NAME }} | |
| METRIC_NAMESPACE: ${{ secrets.METRIC_NAMESPACE }} | |
| GITHUB_TOKEN: ${{ github.token }} | |
| permissions: | |
| id-token: write # This is required for requesting the JWT | |
| jobs: | |
| browser-compatibility-tests: | |
| name: Browser Compatibility Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Package | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup GitHub Actions Host | |
| uses: ./.github/actions/setup-integration-test | |
| with: | |
| aws-role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_SDK_DEV }} | |
| aws-role-session-name: ${{ env.TEST_TYPE }} | |
| sauce-username: ${{ secrets.SAUCE_USERNAME }} | |
| sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }} | |
| browser-compatibility-test: true | |
| - name: Run Audio Test | |
| id: audio_test | |
| continue-on-error: true | |
| working-directory: ./integration | |
| run: npm run test -- --test-name AudioTest --host saucelabs --test-type browser-compatibility | |
| - name: Run Video Test | |
| id: video_test | |
| continue-on-error: true | |
| working-directory: ./integration | |
| run: npm run test -- --test-name VideoTest --host saucelabs --test-type browser-compatibility | |
| # - name: Run Video Processing Test | |
| # working-directory: ./integration | |
| # run: npm run test -- --test-name VideoProcessingTest --host saucelabs --test-type browser-compatibility | |
| - name: Configure AWS Credentials for CloudWatch | |
| if: always() | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_SDK_DEV }} | |
| aws-region: us-east-1 | |
| - name: Send Metric to CloudWatch | |
| if: always() | |
| run: | | |
| npm install @aws-sdk/client-cloudwatch | |
| node -e " | |
| const { CloudWatchClient, PutMetricDataCommand } = require('@aws-sdk/client-cloudwatch'); | |
| const client = new CloudWatchClient({ region: 'us-east-1' }); | |
| const allPassed = '${{ steps.audio_test.outcome }}' === 'success' && '${{ steps.video_test.outcome }}' === 'success'; | |
| const value = allPassed ? 1 : 0; | |
| const command = new PutMetricDataCommand({ | |
| Namespace: process.env.METRIC_NAMESPACE, | |
| MetricData: [{ | |
| MetricName: process.env.METRIC_NAME, | |
| Dimensions: [ | |
| { Name: 'Platform', Value: 'JS SDK Daily Compatibility' } | |
| ], | |
| Value: value, | |
| }] | |
| }); | |
| 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); | |
| }); | |
| " | |
| - name: Fail job if any test failed | |
| if: always() | |
| run: | | |
| if [ "${{ steps.audio_test.outcome }}" != "success" ] || [ "${{ steps.video_test.outcome }}" != "success" ]; then | |
| echo "One or more browser compatibility tests failed (AudioTest=${{ steps.audio_test.outcome }}, VideoTest=${{ steps.video_test.outcome }})" | |
| exit 1 | |
| fi | |
| echo "All browser compatibility tests passed" |