Skip to content

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

ci: add comprehensive install script tests

ShawnPana37f58b4f85b1
diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml
new file mode 100644
index 000000000..467fc9c0d
--- /dev/null
+++ b/.github/workflows/install-script.yml
@@ -0,0 +1,352 @@
+name: Test Install Script
+
+on:
+ push:
+ branches:
+ - main
+ paths:
+ - 'install.sh'
+ - '.github/workflows/install-script.yml'
+ pull_request:
+ paths:
+ - 'install.sh'
+ - '.github/workflows/install-script.yml'
+ workflow_dispatch:
+
+# Cancel in-progress runs when a new commit is pushed
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+env:
+ # Use current branch for testing install.sh
+ BROWSER_USE_BRANCH: ${{ github.head_ref || github.ref_name }}
+ BROWSER_USE_REPO: ${{ github.repository }}
+
+jobs:
+ # ===========================================================================
+ # Test install.sh with different modes on all platforms
+ # ===========================================================================
+
+ test-install-sh-linux:
+ name: install.sh ${{ matrix.mode }} (Linux ${{ matrix.os }})
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, ubuntu-22.04]
+ mode: [--remote-only, --local-only, --full]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Run install.sh ${{ matrix.mode }}
+ run: bash install.sh ${{ matrix.mode }}
+
+ - name: Source shell config
+ run: |
+ source ~/.bashrc || true
+ echo "$HOME/.browser-use-env/bin" >> $GITHUB_PATH
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Verify browser-use CLI
+ run: |
+ source ~/.browser-use-env/bin/activate
+ browser-use --help
+
+ - name: Verify install-config.json
+ run: |
+ cat ~/.browser-use/install-config.json
+ # Verify expected modes based on install flag
+ if [[ "${{ matrix.mode }}" == "--remote-only" ]]; then
+ grep -q '"remote"' ~/.browser-use/install-config.json
+ grep -q '"default_mode": "remote"' ~/.browser-use/install-config.json
+ elif [[ "${{ matrix.mode }}" == "--local-only" ]]; then
+ grep -q '"chromium"' ~/.browser-use/install-config.json
+ grep -q '"default_mode": "chromium"' ~/.browser-use/install-config.json
+ elif [[ "${{ matrix.mode }}" == "--full" ]]; then
+ grep -q '"chromium"' ~/.browser-use/install-config.json
+ grep -q '"remote"' ~/.browser-use/install-config.json
+ fi
+
+ - name: Verify Chromium installed (local/full only)
+ if: matrix.mode != '--remote-only'
+ run: |
+ source ~/.browser-use-env/bin/activate
+ # Check playwright browsers are installed
+ uvx playwright install --dry-run chromium 2>&1 | grep -i "chromium" || true
+ # Verify chromium binary exists in playwright cache
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chrome 2>/dev/null || \
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chromium 2>/dev/null || \
+ echo "Chromium binary check completed"
+
+ - name: Verify cloudflared installed (remote/full only)
+ if: matrix.mode != '--local-only'
+ run: |
+ which cloudflared || ls ~/.local/bin/cloudflared
+ cloudflared --version
+
+ - name: Verify cloudflared NOT installed (local-only)
+ if: matrix.mode == '--local-only'
+ run: |
+ if command -v cloudflared &> /dev/null; then
+ echo "ERROR: cloudflared should not be installed in local-only mode"
+ exit 1
+ fi
+ echo "Confirmed: cloudflared not installed (expected for local-only)"
+
+ - name: Run browser-use doctor
+ run: |
+ source ~/.browser-use-env/bin/activate
+ browser-use doctor
+
+ test-install-sh-macos:
+ name: install.sh ${{ matrix.mode }} (macOS ${{ matrix.os }})
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, macos-13]
+ mode: [--remote-only, --local-only, --full]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Run install.sh ${{ matrix.mode }}
+ run: bash install.sh ${{ matrix.mode }}
+
+ - name: Source shell config
+ run: |
+ source ~/.zshrc || source ~/.bashrc || true
+ echo "$HOME/.browser-use-env/bin" >> $GITHUB_PATH
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Verify browser-use CLI
+ run: |
+ source ~/.browser-use-env/bin/activate
+ browser-use --help
+
+ - name: Verify install-config.json
+ run: |
+ cat ~/.browser-use/install-config.json
+ if [[ "${{ matrix.mode }}" == "--remote-only" ]]; then
+ grep -q '"remote"' ~/.browser-use/install-config.json
+ grep -q '"default_mode": "remote"' ~/.browser-use/install-config.json
+ elif [[ "${{ matrix.mode }}" == "--local-only" ]]; then
+ grep -q '"chromium"' ~/.browser-use/install-config.json
+ grep -q '"default_mode": "chromium"' ~/.browser-use/install-config.json
+ elif [[ "${{ matrix.mode }}" == "--full" ]]; then
+ grep -q '"chromium"' ~/.browser-use/install-config.json
+ grep -q '"remote"' ~/.browser-use/install-config.json
+ fi
+
+ - name: Verify Chromium installed (local/full only)
+ if: matrix.mode != '--remote-only'
+ run: |
+ source ~/.browser-use-env/bin/activate
+ # Check playwright cache for chromium
+ ls ~/Library/Caches/ms-playwright/chromium-*/chrome-mac/ 2>/dev/null || \
+ ls ~/Library/Caches/ms-playwright/chromium-*/Chromium.app 2>/dev/null || \
+ echo "Chromium binary check completed"
+
+ - name: Verify cloudflared installed (remote/full only)
+ if: matrix.mode != '--local-only'
+ run: |
+ which cloudflared || ls ~/.local/bin/cloudflared
+ cloudflared --version
+
+ - name: Verify cloudflared NOT installed (local-only)
+ if: matrix.mode == '--local-only'
+ run: |
+ if command -v cloudflared &> /dev/null; then
+ echo "ERROR: cloudflared should not be installed in local-only mode"
+ exit 1
+ fi
+ echo "Confirmed: cloudflared not installed (expected for local-only)"
+
+ - name: Run browser-use doctor
+ run: |
+ source ~/.browser-use-env/bin/activate
+ browser-use doctor
+
+ test-install-sh-windows:
+ name: install.sh ${{ matrix.mode }} (Windows)
+ strategy:
+ fail-fast: false
+ matrix:
+ mode: [--remote-only, --local-only, --full]
+ runs-on: windows-latest
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup Python (Windows requires manual setup)
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Run install.sh ${{ matrix.mode }}
+ run: bash install.sh ${{ matrix.mode }}
+
+ - name: Add to PATH
+ run: |
+ echo "$HOME/.browser-use-env/Scripts" >> $GITHUB_PATH
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Verify browser-use CLI
+ run: |
+ source ~/.browser-use-env/Scripts/activate
+ browser-use --help
+
+ - name: Verify install-config.json
+ run: |
+ cat ~/.browser-use/install-config.json
+ if [[ "${{ matrix.mode }}" == "--remote-only" ]]; then
+ grep -q '"remote"' ~/.browser-use/install-config.json
+ elif [[ "${{ matrix.mode }}" == "--local-only" ]]; then
+ grep -q '"chromium"' ~/.browser-use/install-config.json
+ elif [[ "${{ matrix.mode }}" == "--full" ]]; then
+ grep -q '"chromium"' ~/.browser-use/install-config.json
+ grep -q '"remote"' ~/.browser-use/install-config.json
+ fi
+
+ - name: Run browser-use doctor
+ run: |
+ source ~/.browser-use-env/Scripts/activate
+ browser-use doctor
+
+ # ===========================================================================
+ # Test alternative install methods: uv pip install + browser-use install
+ # ===========================================================================
+
+ test-uv-pip-install:
+ name: uv pip install (Linux)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install uv
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh
+
+ - name: Add uv to PATH
+ run: echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Create venv and install browser-use
+ run: |
+ uv venv .venv --python 3.11
+ source .venv/bin/activate
+ # Install from current branch
+ uv pip install .
+
+ - name: Run browser-use install (should install Chromium + cloudflared)
+ run: |
+ source .venv/bin/activate
+ browser-use install
+
+ - name: Verify browser-use CLI
+ run: |
+ source .venv/bin/activate
+ browser-use --help
+
+ - name: Verify Chromium installed
+ run: |
+ source .venv/bin/activate
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chrome 2>/dev/null || \
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chromium 2>/dev/null || \
+ echo "Chromium check completed"
+
+ - name: Verify cloudflared installed
+ run: |
+ which cloudflared || ls ~/.local/bin/cloudflared
+ cloudflared --version
+
+ - name: Run browser-use doctor
+ run: |
+ source .venv/bin/activate
+ browser-use doctor
+
+ # ===========================================================================
+ # Test uvx "browser-use[cli]" - ephemeral install
+ # ===========================================================================
+
+ test-uvx-run:
+ name: uvx browser-use[cli] (Linux)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install uv
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh
+
+ - name: Add uv to PATH
+ run: echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Build wheel from current branch
+ run: |
+ uv venv .venv --python 3.11
+ source .venv/bin/activate
+ uv pip install build
+ python -m build --wheel
+
+ - name: Test uvx with local wheel
+ run: |
+ # Install the wheel we just built
+ WHEEL=$(ls dist/*.whl)
+ uvx --from "$WHEEL" browser-use --help
+
+ - name: Test uvx browser-use install
+ run: |
+ WHEEL=$(ls dist/*.whl)
+ uvx --from "$WHEEL" browser-use install
+
+ - name: Verify Chromium installed after uvx install
+ run: |
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chrome 2>/dev/null || \
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chromium 2>/dev/null || \
+ echo "Chromium check completed"
+
+ - name: Verify cloudflared installed after uvx install
+ run: |
+ which cloudflared || ls ~/.local/bin/cloudflared
+ cloudflared --version
+
+ - name: Test uvx browser-use doctor
+ run: |
+ WHEEL=$(ls dist/*.whl)
+ uvx --from "$WHEEL" browser-use doctor
+
+ # ===========================================================================
+ # Test uvx from PyPI (only on main branch after release)
+ # ===========================================================================
+
+ test-uvx-pypi:
+ name: uvx browser-use[cli] from PyPI
+ runs-on: ubuntu-latest
+ # Only run on main branch or manual trigger
+ if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
+ steps:
+ - name: Install uv
+ run: curl -LsSf https://astral.sh/uv/install.sh | sh
+
+ - name: Add uv to PATH
+ run: echo "$HOME/.local/bin" >> $GITHUB_PATH
+
+ - name: Test uvx browser-use --help
+ run: uvx "browser-use[cli]" --help
+
+ - name: Test uvx browser-use install
+ run: uvx "browser-use[cli]" install
+
+ - name: Verify Chromium installed
+ run: |
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chrome 2>/dev/null || \
+ ls ~/.cache/ms-playwright/chromium-*/chrome-linux/chromium 2>/dev/null || \
+ echo "Chromium check completed"
+
+ - name: Verify cloudflared installed
+ run: |
+ which cloudflared || ls ~/.local/bin/cloudflared
+ cloudflared --version
+
+ - name: Test uvx browser-use doctor
+ run: uvx "browser-use[cli]" doctor