@@ -81,36 +81,24 @@ jobs:
8181 ${{ runner.os }}-playwright-${{ matrix.browser }}-
8282 ${{ runner.os }}-playwright-v2-
8383 # Browser-specific installation strategy
84- - name : Install Playwright browsers
84+ # Install system dependencies FIRST (requires sudo)
85+ - name : Install browser system dependencies
86+ if : matrix.browser == 'webkit' || matrix.browser == 'firefox'
8587 working-directory : ./react-example
8688 run : |
87- echo "📥 Installing ${{ matrix.browser }} browser..."
88-
89- # Smart installation based on browser type and cache status
90- cache_hit="${{ steps.playwright-cache.outputs.cache-hit }}"
91-
92- if [ "$cache_hit" = "true" ]; then
93- echo "Cache hit: Installing browser only..."
94- yarn playwright install ${{ matrix.browser }}
95- elif [ "${{ matrix.browser }}" = "webkit" ]; then
96- echo "Cache miss + WebKit: Installing with dependencies..."
97- yarn playwright install ${{ matrix.browser }} --with-deps
98- elif [ "${{ matrix.browser }}" = "firefox" ]; then
99- echo "Cache miss + Firefox: Installing with dependencies..."
100- yarn playwright install ${{ matrix.browser }} --with-deps
101- else
102- echo "Cache miss + Chromium: Installing browser only..."
103- yarn playwright install ${{ matrix.browser }}
104- fi
105- # WebKit-specific dependency fix (Ubuntu 22.04 compatibility)
106- - name : Fix WebKit dependencies
107- if : matrix.browser == 'webkit'
89+ echo "🔧 Installing ${{ matrix.browser }} system dependencies..."
90+ # install-deps must run with sudo to install system packages
91+ sudo npx playwright install-deps ${{ matrix.browser }}
92+ echo "✅ System dependencies installed"
93+
94+ # Then install browser binaries (no sudo needed)
95+ - name : Install Playwright browsers
96+ working-directory : ./react-example
10897 run : |
109- echo "🔧 Applying WebKit Ubuntu 22.04 fixes..."
110- sudo apt-get update -qq
111- # Install the exact library versions WebKit needs
112- sudo apt-get install -y libwoff2-1.1.0 libwoff2dec1 fonts-liberation || true
113- echo "✅ WebKit dependencies updated"
98+ echo "📥 Installing ${{ matrix.browser }} browser binary..."
99+ # Install browser only - dependencies already installed above
100+ yarn playwright install ${{ matrix.browser }}
101+ echo "✅ Browser installed"
114102
115103 # Browser environment setup (flags now handled by Playwright config)
116104 - name : Setup browser environment
0 commit comments