Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Add setup-chromium job to pre-cache chromium before parallel test runs

Magnus Müller2c7d3372e141
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index dde010ad6..0ae86f669 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -24,6 +24,27 @@ on:
workflow_dispatch:
jobs:
+ setup-chromium:
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ steps:
+ - uses: actions/checkout@v4
+ - uses: astral-sh/setup-uv@v6
+
+ - name: Cache chromium binaries
+ id: cache-chromium
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cache/ms-playwright
+ key: ${{ runner.os }}-${{ runner.arch }}-chromium-${{ hashFiles('uv.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-${{ runner.arch }}-chromium-
+
+ - name: Install Chromium if not cached
+ if: steps.cache-chromium.outputs.cache-hit != 'true'
+ run: uvx playwright install chromium --with-deps --no-shell
+
find_tests:
runs-on: ubuntu-latest
timeout-minutes: 5 # Prevent hanging
@@ -41,7 +62,7 @@ jobs:
echo "Git commit: $(git rev-parse HEAD)"
echo "Git branch: $(git branch --show-current)"
echo ""
-
+
TEST_FILENAMES="$(ls tests/ci/test_*.py | sed 's|^tests/ci/||' | sed 's|\.py$||' | jq -R -s -c 'split("\n")[:-1]')"
echo "TEST_FILENAMES=${TEST_FILENAMES}" >> "$GITHUB_OUTPUT"
echo "📋 Test matrix: $TEST_FILENAMES"
@@ -54,7 +75,7 @@ jobs:
fi
tests:
- needs: find_tests
+ needs: [setup-chromium, find_tests]
runs-on: ubuntu-latest
timeout-minutes: 10 # Prevent individual tests from hanging
env:
@@ -129,6 +150,7 @@ jobs:
fi
evaluate-tasks:
+ needs: setup-chromium
runs-on: ubuntu-latest
env:
IN_DOCKER: 'true'
diff --git a/tests/ci/evaluate_tasks.py b/tests/ci/evaluate_tasks.py
index 034de133c..f82506fca 100644
--- a/tests/ci/evaluate_tasks.py
+++ b/tests/ci/evaluate_tasks.py
@@ -17,7 +17,7 @@ import anyio
import yaml
from pydantic import BaseModel
-from browser_use import Agent, AgentHistoryList, BrowserProfile, BrowserSession, ChatGoogle
+from browser_use import Agent, AgentHistoryList, BrowserProfile, BrowserSession, ChatBrowserUse
from browser_use.llm.messages import UserMessage
# --- CONFIG ---
@@ -56,8 +56,8 @@ async def run_single_task(task_file):
print(f'[DEBUG] Task: {task[:100]}...', file=sys.stderr)
print(f'[DEBUG] Max steps: {max_steps}', file=sys.stderr)
- agent_llm = ChatGoogle(model='gemini-flash-latest')
- judge_llm = ChatGoogle(model='gemini-flash-latest')
+ agent_llm = ChatBrowserUse()
+ judge_llm = ChatBrowserUse()
print('[DEBUG] LLMs initialized', file=sys.stderr)
# Each subprocess gets its own profile and session