[PR #8073] [MERGED] chore(ci): optimize Playwright browser installs in E2E #7728

Closed
opened 2026-03-13 13:47:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8073
Author: @starslingdev[bot]
Created: 2/20/2026
Status: Merged
Merged: 2/20/2026
Merged by: @Bekacru

Base: canaryHead: starsling/fix-playwright-browsers


📝 Commits (1)

  • 9edb89a chore(ci): remove or cache Playwright browser installs in E2E

📊 Changes

2 files changed (+69 additions, -7 deletions)

View changed files

.github/actions/setup-playwright/action.yml (+68 -0)
📝 .github/workflows/e2e.yml (+1 -7)

📄 Description

chore(ci): optimize Playwright browser installs in E2E

Your e2e workflow installs all three Playwright browsers on every CI run, but only Chromium is used.

Fix

  • integration — install only Chromium, matching the single project in your Playwright config. Cache browser binaries at ~/.cache/ms-playwright keyed by Playwright version.
  • adapter-integration — remove the Playwright install step entirely. These jobs run Vitest in Node mode and never launch a browser.

Estimated time saved

e2e.yml consumed 41,577 minutes last month. This should save ~6,600 min/mo (~1,320 hours/yr) of CI wait time:

Source Per job run Job runs/mo Savings/mo
Remove browser install from 6 adapter jobs 54s 5,657 ~5,100 min
Cache Playwright in integration job (54s → 20s) 34s 2,647 ~1,500 min
Total ~6,600 min

Changes

  • .github/actions/setup-playwright/action.yml
  • .github/workflows/e2e.yml

References


Summary by cubic

Optimize E2E CI by installing only Playwright Chromium and caching browser binaries; remove unnecessary installs from adapter jobs. This cuts CI time by ~6,600 minutes per month.

  • New Features

    • Add composite action to cache Playwright browsers keyed by OS, requested browsers, and @playwright/test version.
    • Detect Playwright version, install Chromium with OS deps on cache miss, and run install-deps on cache hit.
  • Refactors

    • Use the new setup action in the integration job.
    • Remove Playwright install from adapter-integration jobs (Vitest runs in Node, no browser).

Written for commit 9edb89a4be. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8073 **Author:** [@starslingdev[bot]](https://github.com/apps/starslingdev) **Created:** 2/20/2026 **Status:** ✅ Merged **Merged:** 2/20/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `starsling/fix-playwright-browsers` --- ### 📝 Commits (1) - [`9edb89a`](https://github.com/better-auth/better-auth/commit/9edb89a4bea49a6c434fb75ff572b29de13aaa83) chore(ci): remove or cache Playwright browser installs in E2E ### 📊 Changes **2 files changed** (+69 additions, -7 deletions) <details> <summary>View changed files</summary> ➕ `.github/actions/setup-playwright/action.yml` (+68 -0) 📝 `.github/workflows/e2e.yml` (+1 -7) </details> ### 📄 Description ## chore(ci): optimize Playwright browser installs in E2E Your e2e workflow installs all three Playwright browsers on every CI run, but only Chromium is used. ### Fix - **`integration`** — install only Chromium, matching the single project in your [Playwright config](https://github.com/better-auth/better-auth/blob/07d80082fce33871f543f5d5191cfbf0b22adb21/e2e/integration/playwright.config.ts#L14-L19). Cache browser binaries at `~/.cache/ms-playwright` keyed by Playwright version. - **`adapter-integration`** — remove the Playwright install step entirely. These jobs run [Vitest in Node mode](https://github.com/better-auth/better-auth/blob/07d80082fce33871f543f5d5191cfbf0b22adb21/e2e/adapter/test/adapter-factory/vitest.config.ts#L1-L3) and never launch a browser. ### Estimated time saved `e2e.yml` consumed [41,577 minutes last month](https://github.com/better-auth/better-auth/actions/metrics/usage?dateRangeType=DATE_RANGE_TYPE_PREVIOUS_MONTH&tab=jobs). This should save ~6,600 min/mo (~1,320 hours/yr) of CI wait time: | Source | Per job run | Job runs/mo | Savings/mo | |--------|-----------|-------------|------------| | Remove browser install from 6 adapter jobs | 54s | 5,657 | ~5,100 min | | Cache Playwright in integration job (54s → 20s) | 34s | 2,647 | ~1,500 min | | **Total** | | | **~6,600 min** | ### Changes - `.github/actions/setup-playwright/action.yml` - `.github/workflows/e2e.yml` ### References - [Playwright: install CLI](https://playwright.dev/docs/browsers#install-browsers) — `playwright install chromium` installs only Chromium - [`e2e.yml` integration job](https://github.com/better-auth/better-auth/blob/07d80082fce33871f543f5d5191cfbf0b22adb21/.github/workflows/e2e.yml#L100-L103) | [adapter-integration job](https://github.com/better-auth/better-auth/blob/07d80082fce33871f543f5d5191cfbf0b22adb21/.github/workflows/e2e.yml#L157-L160) - [No `@vitest/browser` in workspace](https://github.com/better-auth/better-auth/blob/07d80082fce33871f543f5d5191cfbf0b22adb21/package.json#L38-L57) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Optimize E2E CI by installing only Playwright Chromium and caching browser binaries; remove unnecessary installs from adapter jobs. This cuts CI time by ~6,600 minutes per month. - **New Features** - Add composite action to cache Playwright browsers keyed by OS, requested browsers, and @playwright/test version. - Detect Playwright version, install Chromium with OS deps on cache miss, and run install-deps on cache hit. - **Refactors** - Use the new setup action in the integration job. - Remove Playwright install from adapter-integration jobs (Vitest runs in Node, no browser). <sup>Written for commit 9edb89a4bea49a6c434fb75ff572b29de13aaa83. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:47:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7728