diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index c61b30ecc5..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: ci - -on: [push, pull_request] - -jobs: - should-skip: - continue-on-error: true - runs-on: ubuntu-latest - # Map a step output to a job output - outputs: - should-skip-job: ${{steps.skip-check.outputs.should_skip}} - steps: - - id: skip-check - uses: fkirc/skip-duplicate-actions@v5.3.1 - with: - github_token: ${{github.token}} - - ci: - needs: should-skip - if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - test-type: [unit, coverage] - env: - BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}} - BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}} - CI_TEST_TYPE: ${{matrix.test-type}} - runs-on: ${{matrix.os}} - steps: - - name: checkout code - uses: actions/checkout@v4 - - - name: read node version from .nvmrc - run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT - shell: bash - id: nvm - - - name: update apt cache on linux w/o browserstack - run: sudo apt-get update - - - name: install ffmpeg/pulseaudio for firefox on linux w/o browserstack - run: sudo apt-get install ffmpeg pulseaudio - - - name: start pulseaudio for firefox on linux w/o browserstack - run: pulseaudio -D - - - name: setup node - uses: actions/setup-node@v4 - with: - node-version: '${{steps.nvm.outputs.NVMRC}}' - cache: npm - - # turn off the default setup-node problem watchers... - - run: echo "::remove-matcher owner=eslint-compact::" - - run: echo "::remove-matcher owner=eslint-stylish::" - - run: echo "::remove-matcher owner=tsc::" - - - name: npm install - run: npm i --prefer-offline --no-audit - - - name: run npm test - run: npm run test - - - name: coverage - uses: codecov/codecov-action@v4 - with: - token: ${{secrets.CODECOV_TOKEN}} - files: './test/dist/coverage/coverage-final.json' - fail_ci_if_error: true - if: ${{startsWith(env.CI_TEST_TYPE, 'coverage')}} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index bb58205146..0000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Lock Threads' - -on: - schedule: - - cron: '0 1 * * 1,4' - workflow_dispatch: - -permissions: - issues: write - -concurrency: - group: lock - -jobs: - action: - if: ${{ github.repository_owner == 'videojs' }} - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v4 - with: - issue-inactive-days: '60' - process-only: 'issues' diff --git a/.github/workflows/maxim-legacy-browser-tests.yml b/.github/workflows/maxim-legacy-browser-tests.yml new file mode 100644 index 0000000000..66b956bbc4 --- /dev/null +++ b/.github/workflows/maxim-legacy-browser-tests.yml @@ -0,0 +1,108 @@ +name: Maxim Legacy Browser Tests + +on: + push: + branches: [main, maxim-legacy-browser-tests, fix/cr66-legacy-compat] + pull_request: + branches: [main] + workflow_dispatch: + +env: + AWS_REGION: us-west-2 + ECR_REGISTRY: 864899829402.dkr.ecr.us-west-2.amazonaws.com + TARGET_URL: http://172.17.0.1:9999 + +jobs: + legacy-browser-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build video.js + run: npm run build-dev + + - name: Prepare sandbox + run: cp sandbox/index.html.example sandbox/index.html + + - name: Start local web server + run: | + docker run -d --name local-app -p 9999:80 \ + -v ${{ github.workspace }}:/usr/share/nginx/html:ro \ + nginx:alpine + sleep 2 + curl -sf http://localhost:9999/sandbox/index.html > /dev/null + echo "Video.js sandbox running at http://localhost:9999" + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Login to ECR + run: | + aws ecr get-login-password --region ${{ env.AWS_REGION }} \ + | docker login --username AWS --password-stdin ${{ env.ECR_REGISTRY }} + + - name: Pull browser images + run: | + for img in chromium-38 chromium-44 chromium-46 chromium-53 chromium-66 wpe-webkit; do + docker pull ${{ env.ECR_REGISTRY }}/tanagram/maxim/${img}:latest + done + + - name: Pull maxim runner image + run: docker pull ${{ env.ECR_REGISTRY }}/tanagram/maxim/runner:latest + + - name: Run Maxim legacy browser tests + run: | + mkdir -p ${{ github.workspace }}/maxim-results + docker run --rm \ + --network host \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v ${{ github.workspace }}/maxim-results:/results \ + -e TARGET_URL=${{ env.TARGET_URL }}/sandbox/index.html \ + ${{ env.ECR_REGISTRY }}/tanagram/maxim/runner:latest \ + --config configs/smoke-test.yaml \ + --url ${{ env.TARGET_URL }}/sandbox/index.html \ + --browsers cr38,cr44,cr46,cr53,cr66,wpe \ + --parallel 5 \ + --output /results/ + + - name: Stop local web server + if: always() + run: docker rm -f local-app || true + + - name: Upload test results + if: always() + uses: actions/upload-artifact@v4 + with: + name: maxim-results + path: ${{ github.workspace }}/maxim-results/ + + - name: Publish JUnit report + if: always() + uses: mikepenz/action-junit-report@v4 + with: + report_paths: ${{ github.workspace }}/maxim-results/results.xml + check_name: Legacy Browser Tests + + - name: Check for failures + run: | + RESULTS="${{ github.workspace }}/maxim-results/results.json" + if [ -f "$RESULTS" ]; then + FAILED=$(jq '.summary.failed' "$RESULTS") + if [ "$FAILED" != "0" ]; then + echo "::error::Maxim detected ${FAILED} legacy browser test failure(s)" + exit 1 + fi + fi diff --git a/.github/workflows/pr-titles.yml b/.github/workflows/pr-titles.yml deleted file mode 100644 index 0c62fd3e1b..0000000000 --- a/.github/workflows/pr-titles.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: PR title check - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.number }} - cancel-in-progress: true - -jobs: - pr-title-lint: - name: Should follow conventional commit spec - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - run: npm i @actions/core @actions/github - - run: node .github/actions/pr-titles.mjs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f87f9fe0fc..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: release -on: - push: - tags: - # match semver versions - - "v[0-9]+.[0-9]+.[0-9]+" - # match semver pre-releases - - "v[0-9]+.[0-9]+.[0-9]+-*" -jobs: - release: - env: - NETLIFY_BASE: 'videojs-preview.netlify.app' - runs-on: ubuntu-latest - permissions: - contents: write # Required for creating a release - discussions: write # Required for creating a release - id-token: write # Required for provenance - packages: write # Required for publishing - steps: - - name: Checkout - uses: actions/checkout@v3 - # We need to fetch the entire history as conventional-changelog needs - # access to any number of git commits to build the changelog. - with: - fetch-depth: 0 - - - name: read node version from .nvmrc - run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT - shell: bash - id: nvm - - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: '${{steps.nvm.outputs.NVMRC}}' - cache: npm - # this line is required for the setup-node action to be able to run the npm publish below. - registry-url: 'https://registry.npmjs.org' - - - name: npm install - run: npm i --prefer-offline --no-audit - - # publish runs build for us via a prepublishOnly script - - name: npm release - run: npm publish --provenance --tag next - - - name: get current changelog - run: node -e "console.log(require('./build/current-changelog.js')())" > CHANGELOG-LATEST.md - - - name: get dashed package version for netlify - run: echo "VERSION=$(node -e "process.stdout.write(require('./package.json').version.split('.').join('-'))")" >> $GITHUB_OUTPUT - id: get-version - shell: bash - if: env.NETLIFY_BASE != '' - - - name: add netlify preview to release notes - run: | - echo "" >> CHANGELOG-LATEST.md - echo "[netlify preview for this version](https://v${{steps.get-version.outputs.VERSION}}--${{env.NETLIFY_BASE}})" >> CHANGELOG-LATEST.md - if: env.NETLIFY_BASE != '' - - - name: Create Github release - uses: softprops/action-gh-release@v1 - with: - body_path: CHANGELOG-LATEST.md - token: ${{github.token}} - prerelease: true - files: dist/*.zip - discussion_category_name: Releases - - deploy: - needs: release - runs-on: ubuntu-latest - environment: Deploy - env: - VJS_VERSION: ${{ github.event.head_commit.message }} - S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} - S3_ACCESS: ${{ secrets.AWS_S3_ACCESS }} - S3_KEY: ${{ secrets.AWS_S3_KEY }} - steps: - - name: setup node - uses: actions/setup-node@v3 - - - name: npm install video.js - run: npm install "video.js@$VJS_VERSION" - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_S3_SECRET }} - aws-region: us-east-1 - - - name: Copy files to the CDN with the AWS CLI - run: | - aws s3 cp node_modules/video.js/dist s3://${S3_BUCKET}/${S3_KEY}/${VJS_VERSION}/ --acl ${S3_ACCESS} --recursive