|
| 1 | +name: Maxim Legacy Browser Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, maxim-legacy-browser-tests, fix/cr66-legacy-compat] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +env: |
| 11 | + AWS_REGION: us-west-2 |
| 12 | + ECR_REGISTRY: 864899829402.dkr.ecr.us-west-2.amazonaws.com |
| 13 | + TARGET_URL: http://172.17.0.1:9999 |
| 14 | + |
| 15 | +jobs: |
| 16 | + legacy-browser-tests: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up Node.js |
| 22 | + uses: actions/setup-node@v4 |
| 23 | + with: |
| 24 | + node-version: 18 |
| 25 | + cache: npm |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: npm ci |
| 29 | + |
| 30 | + - name: Build video.js |
| 31 | + run: npm run build-dev |
| 32 | + |
| 33 | + - name: Prepare sandbox |
| 34 | + run: cp sandbox/index.html.example sandbox/index.html |
| 35 | + |
| 36 | + - name: Start local web server |
| 37 | + run: | |
| 38 | + docker run -d --name local-app -p 9999:80 \ |
| 39 | + -v ${{ github.workspace }}:/usr/share/nginx/html:ro \ |
| 40 | + nginx:alpine |
| 41 | + sleep 2 |
| 42 | + curl -sf http://localhost:9999/sandbox/index.html > /dev/null |
| 43 | + echo "Video.js sandbox running at http://localhost:9999" |
| 44 | +
|
| 45 | + - name: Configure AWS credentials |
| 46 | + uses: aws-actions/configure-aws-credentials@v4 |
| 47 | + with: |
| 48 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 49 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 50 | + aws-region: ${{ env.AWS_REGION }} |
| 51 | + |
| 52 | + - name: Login to ECR |
| 53 | + run: | |
| 54 | + aws ecr get-login-password --region ${{ env.AWS_REGION }} \ |
| 55 | + | docker login --username AWS --password-stdin ${{ env.ECR_REGISTRY }} |
| 56 | +
|
| 57 | + - name: Pull browser images |
| 58 | + run: | |
| 59 | + for img in chromium-38 chromium-44 chromium-46 chromium-53 chromium-66 wpe-webkit; do |
| 60 | + docker pull ${{ env.ECR_REGISTRY }}/tanagram/maxim/${img}:latest |
| 61 | + done |
| 62 | +
|
| 63 | + - name: Pull maxim runner image |
| 64 | + run: docker pull ${{ env.ECR_REGISTRY }}/tanagram/maxim/runner:latest |
| 65 | + |
| 66 | + - name: Run Maxim legacy browser tests |
| 67 | + run: | |
| 68 | + mkdir -p ${{ github.workspace }}/maxim-results |
| 69 | + docker run --rm \ |
| 70 | + --network host \ |
| 71 | + -v /var/run/docker.sock:/var/run/docker.sock \ |
| 72 | + -v ${{ github.workspace }}/maxim-results:/results \ |
| 73 | + -e TARGET_URL=${{ env.TARGET_URL }}/sandbox/index.html \ |
| 74 | + ${{ env.ECR_REGISTRY }}/tanagram/maxim/runner:latest \ |
| 75 | + --config configs/smoke-test.yaml \ |
| 76 | + --url ${{ env.TARGET_URL }}/sandbox/index.html \ |
| 77 | + --browsers cr38,cr44,cr46,cr53,cr66,wpe \ |
| 78 | + --parallel 5 \ |
| 79 | + --output /results/ |
| 80 | +
|
| 81 | + - name: Stop local web server |
| 82 | + if: always() |
| 83 | + run: docker rm -f local-app || true |
| 84 | + |
| 85 | + - name: Upload test results |
| 86 | + if: always() |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: maxim-results |
| 90 | + path: ${{ github.workspace }}/maxim-results/ |
| 91 | + |
| 92 | + - name: Publish JUnit report |
| 93 | + if: always() |
| 94 | + uses: mikepenz/action-junit-report@v4 |
| 95 | + with: |
| 96 | + report_paths: ${{ github.workspace }}/maxim-results/results.xml |
| 97 | + check_name: Legacy Browser Tests |
| 98 | + |
| 99 | + - name: Check for failures |
| 100 | + run: | |
| 101 | + RESULTS="${{ github.workspace }}/maxim-results/results.json" |
| 102 | + if [ -f "$RESULTS" ]; then |
| 103 | + FAILED=$(jq '.summary.failed' "$RESULTS") |
| 104 | + if [ "$FAILED" != "0" ]; then |
| 105 | + echo "::error::Maxim detected ${FAILED} legacy browser test failure(s)" |
| 106 | + exit 1 |
| 107 | + fi |
| 108 | + fi |
0 commit comments