From 73ee17c81cc19e01a9562b85971e8a4f4db4c201 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 16:26:35 +0000 Subject: [PATCH 1/2] chore(deps): bump css_parser from 1.14.0 to 1.22.0 Bumps [css_parser](https://github.com/premailer/css_parser) from 1.14.0 to 1.22.0. - [Changelog](https://github.com/premailer/css_parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/premailer/css_parser/compare/v1.14.0...v1.22.0) --- updated-dependencies: - dependency-name: css_parser dependency-version: 1.22.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 80ae66dff..ffb55cca0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -160,7 +160,7 @@ GEM bigdecimal rexml crass (1.0.6) - css_parser (1.14.0) + css_parser (1.22.0) addressable csv (3.3.5) database_cleaner (2.1.0) From 624ec5f0e2b3a4ade00c9a1f0055f5308143c7c3 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Thu, 14 May 2026 09:45:34 +0200 Subject: [PATCH 2/2] fix(ci): use chromium-headless-shell with isolated caches Fix race condition in parallel test jobs by adding matrix index to cache key. Use chromium-headless-shell by passing executable_path to Playwright driver. Changes: - Add ${{ matrix.ci_node_index }} to cache key for isolated caches per job - Install chromium-headless-shell instead of full chromium - Detect and use headless_shell executable in capybara driver config --- .github/workflows/ruby.yml | 8 +++----- spec/support/capybara.rb | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 49177e339..20838cafa 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -46,14 +46,12 @@ jobs: id: playwright-cache with: path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-chromium-headless-shell-1.59.0 + key: playwright-${{ runner.os }}-chromium-headless-shell-1.59.0-${{ matrix.ci_node_index }} - - name: Install Playwright Chromium Headless Shell (cache miss) - if: steps.playwright-cache.outputs.cache-hit != 'true' + - name: Install Playwright Chromium Headless Shell run: npx --yes playwright@1.59.0 install chromium-headless-shell - - name: Install Playwright system deps (cache hit) - if: steps.playwright-cache.outputs.cache-hit == 'true' + - name: Install Playwright system dependencies run: npx --yes playwright@1.59.0 install-deps chromium-headless-shell - name: Setup test databases diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index a18952825..d63699871 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -6,10 +6,25 @@ # See: https://playwright.dev/docs/browsers#chromium-headless-shell Capybara.register_driver :playwright do |app| + # Use chromium-headless-shell if available (CI), fallback to regular chromium + # Try multiple patterns to find the headless shell executable on different platforms + cache_dir = File.expand_path('~/.cache/ms-playwright') + patterns = [ + 'chromium_headless_shell-*/**/headless_shell', # Linux + 'chromium_headless_shell-*/**/chrome-headless-shell', # Mac + ] + + headless_shell = patterns.map do |pattern| + Dir.glob(File.join(cache_dir, pattern)).max + end.compact.first + + executable_path = headless_shell if headless_shell && File.executable?(headless_shell) + Capybara::Playwright::Driver.new( app, headless: ENV.fetch('PLAYWRIGHT_HEADLESS', 'true') !~ /^(false|no|0)$/i, - browser_type: ENV.fetch('PLAYWRIGHT_BROWSER', 'chromium').to_sym + browser_type: ENV.fetch('PLAYWRIGHT_BROWSER', 'chromium').to_sym, + executablePath: executable_path ) end