name: Player Safari perf permissions: contents: read env: HYPERFRAMES_NO_TELEMETRY: "1" on: pull_request: paths: - "packages/player/**" - "packages/core/src/runtime/**" - ".github/workflows/player-safari.yml" schedule: - cron: "23 7 * * *" # One film many times: a fault that shows once in fifty runs needs hundreds of runs to prove gone. workflow_dispatch: inputs: fixtures: description: "Films to run, comma-separated (empty runs every heavy film)" default: "" runs: description: "Runs of each film" default: "2" browsers: description: "Browsers, comma-separated" default: "safari,chrome" concurrency: # Each dispatch is its own group: the runs of one proof go side by side instead of cancelling each other. group: player-safari-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || 'auto' }} cancel-in-progress: true jobs: changes: name: Detect changes runs-on: ubuntu-latest timeout-minutes: 4 outputs: release_only: ${{ steps.release.outputs.release_only }} steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: fetch-depth: 0 - name: Find a release-only diff id: release uses: ./.github/actions/release-only-diff heavy-films: name: "Heavy films: Safari vs Chrome" needs: changes # A release PR changes versions and notes only; a failed change detection must not skip the films. if: ${{ !cancelled() && needs.changes.outputs.release_only != 'true' }} runs-on: macos-latest timeout-minutes: 45 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: 22 - run: bun install --frozen-lockfile # The bench serves packages/player/dist and packages/core/dist, as the Linux perf shards do. - run: bun run build - name: Generate heavy media run: | brew install ffmpeg bash packages/player/tests/perf/browsers/make-media.sh - name: Enable safaridriver run: sudo safaridriver --enable - name: Run heavy films in Safari and Chrome working-directory: packages/player env: FIXTURES: ${{ inputs.fixtures }} RUNS: ${{ inputs.runs || '2' }} BROWSERS: ${{ inputs.browsers || 'safari,chrome' }} run: | sw_vers CHROMEDRIVER="$CHROMEWEBDRIVER/chromedriver" bun run tests/perf/browsers/run.ts \ --browsers "$BROWSERS" --runs "$RUNS" ${FIXTURES:+--fixtures "$FIXTURES"} - name: Upload results if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: player-safari-heavy-films path: packages/player/tests/perf/results/ if-no-files-found: warn retention-days: 30