From ee55ee2d05df9d3fb1a0e69b3c81948073eacfc2 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 8 Oct 2026 16:54:18 +0200 Subject: [PATCH 1/2] ci: Install Playwright in the background during E2E app builds Each E2E job spent about 25s installing Playwright after the app build, even though the install only needs the Playwright version. Most apps use the same version as the root workspace, so start that install in the background right after restoring caches. After the build, the app's own version is installed only if it differs from the root one. Co-Authored-By: Claude Opus 5.5 --- .github/actions/install-playwright/action.yml | 12 ++++++++ .github/workflows/build.yml | 28 +++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-playwright/action.yml b/.github/actions/install-playwright/action.yml index d2f1fd723b1a..6c8ea05d3c91 100644 --- a/.github/actions/install-playwright/action.yml +++ b/.github/actions/install-playwright/action.yml @@ -7,6 +7,15 @@ inputs: cwd: description: 'The working directory to run Playwright in.' default: '.' + installed-version: + description: + 'A Playwright version that an earlier run of this action already installed. Skips the install if it matches.' + default: '' + +outputs: + version: + description: 'The resolved Playwright version, empty if Playwright is not installed or the install was skipped.' + value: ${{ steps.playwright-version.outputs.version }} runs: using: 'composite' @@ -18,8 +27,11 @@ runs: id: playwright-version run: | version=$(node -e "let v = ''; try { v = require('@playwright/test/package.json').version; } catch {} process.stdout.write(String(v));") + if [ "$version" = "$INSTALLED_VERSION" ]; then version=''; fi echo "version=$version" >> "$GITHUB_OUTPUT" shell: bash + env: + INSTALLED_VERSION: ${{ inputs.installed-version }} working-directory: ${{ inputs.cwd }} - name: Restore cached playwright binaries diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a37d3618311f..75d7b34bb513 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1078,6 +1078,15 @@ jobs: with: dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }} + # Installs the root workspace's Playwright version while the app builds. Most apps use the same version. + # The app's own version is only known after its build, so it gets installed then if it differs. + - name: Install Playwright + id: install-playwright + background: true + uses: ./.github/actions/install-playwright + with: + browsers: chromium + - name: Restore tarball artifacts uses: actions/download-artifact@v8 with: @@ -1116,11 +1125,14 @@ jobs: env: SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }} - - name: Install Playwright + - wait: [install-playwright] + + - name: Install Playwright for the app's version uses: ./.github/actions/install-playwright with: browsers: chromium cwd: ${{ runner.temp }}/test-application + installed-version: ${{ steps.install-playwright.outputs.version }} - name: Run E2E test working-directory: ${{ runner.temp }}/test-application @@ -1214,6 +1226,15 @@ jobs: with: dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }} + # Installs the root workspace's Playwright version while the app builds. Most apps use the same version. + # The app's own version is only known after its build, so it gets installed then if it differs. + - name: Install Playwright + id: install-playwright + background: true + uses: ./.github/actions/install-playwright + with: + browsers: chromium + - name: Restore tarball artifacts uses: actions/download-artifact@v8 with: @@ -1243,11 +1264,14 @@ jobs: timeout-minutes: 7 run: ${{ matrix.build-command || 'pnpm test:build' }} - - name: Install Playwright + - wait: [install-playwright] + + - name: Install Playwright for the app's version uses: ./.github/actions/install-playwright with: browsers: chromium cwd: ${{ runner.temp }}/test-application + installed-version: ${{ steps.install-playwright.outputs.version }} - name: Run E2E test working-directory: ${{ runner.temp }}/test-application From 7418538901e26ac69a9ac320d97f2753c14fc6bd Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Fri, 9 Oct 2026 11:11:24 +0200 Subject: [PATCH 2/2] ci: Start background Playwright install after artifact downloads Starting the background install right next to `download-artifact` made 13 of about 270 E2E jobs fail in a full run with "Unexpected end of JSON input" while the action read the event file. Start it after the downloads instead, where the next steps are plain shell commands. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75d7b34bb513..606383ac002d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1078,15 +1078,6 @@ jobs: with: dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }} - # Installs the root workspace's Playwright version while the app builds. Most apps use the same version. - # The app's own version is only known after its build, so it gets installed then if it differs. - - name: Install Playwright - id: install-playwright - background: true - uses: ./.github/actions/install-playwright - with: - browsers: chromium - - name: Restore tarball artifacts uses: actions/download-artifact@v8 with: @@ -1100,6 +1091,16 @@ jobs: name: build-layer-output path: ${{ env.BUILD_LAYER_PATH }} + # Installs the root workspace's Playwright version while the app builds. Most apps use the same version. + # The app's own version is only known after its build, so it gets installed then if it differs. + # Started after the artifact downloads: starting next to them made `download-artifact` fail to read the event file. + - name: Install Playwright + id: install-playwright + background: true + uses: ./.github/actions/install-playwright + with: + browsers: chromium + - name: Prepare e2e tests run: yarn test:prepare working-directory: dev-packages/e2e-tests @@ -1226,8 +1227,15 @@ jobs: with: dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }} + - name: Restore tarball artifacts + uses: actions/download-artifact@v8 + with: + name: build-tarball-output + path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }} + # Installs the root workspace's Playwright version while the app builds. Most apps use the same version. # The app's own version is only known after its build, so it gets installed then if it differs. + # Started after the artifact downloads: starting next to them made `download-artifact` fail to read the event file. - name: Install Playwright id: install-playwright background: true @@ -1235,12 +1243,6 @@ jobs: with: browsers: chromium - - name: Restore tarball artifacts - uses: actions/download-artifact@v8 - with: - name: build-tarball-output - path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }} - - name: Prepare E2E tests run: yarn test:prepare working-directory: dev-packages/e2e-tests