Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
prevent github actions from running twice for each commit
Nick Sweeting405bf63c9bd3
diff --cc .github/workflows/build.yamlindex 000000000,3ac553301..38d963066mode 000000,100644..100644--- a/.github/workflows/build.yaml+++ b/.github/workflows/build.yaml@@@ -1,0 -1,59 +1,70 @@@-name: Build and Test++name: build+ on:+ push:++ branches:++ - main++ - stable++ - 'releases/**'++ tags:++ - '*'+ pull_request:++ branches:++ - main++ - stable++ - 'releases/**'+ workflow_dispatch:++ jobs:+ build:+ name: Build Package+ runs-on: ubuntu-latest++ if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork))+ steps:+ - uses: actions/checkout@v4++ - name: Setup uv and cache packages+ uses: astral-sh/setup-uv@v5++ - name: Build the package+ run: uv build --python 3.12++ - name: Upload build artifact+ uses: actions/upload-artifact@v4+ with:+ name: dist-artifact+ path: |+ dist/*.whl+ dist/*.tar.gz++ build_test:+ name: ${{ matrix.os }} • ${{ matrix.python-version }}+ needs: build+ runs-on: ${{ matrix.os }}++ if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork))+ strategy:+ matrix:+ os: [ubuntu-latest, macos-latest, windows-latest]+ python-version: ["3.11", "3.12", "3.13"]++ steps:+ - uses: actions/checkout@v4++ - name: Setup uv and cache packages+ uses: astral-sh/setup-uv@v5++ - name: Download build artifact+ uses: actions/download-artifact@v4+ with:+ name: dist-artifact++ - name: Set up venv and test for OS/Python versions+ shell: bash+ run: |+ uv venv /tmp/testenv --python ${{ matrix.python-version }}+ if [[ "$RUNNER_OS" == "Windows" ]]; then+ . /tmp/testenv/Scripts/activate+ else+ source /tmp/testenv/bin/activate+ fi+ uv pip install *.whl+ python -c 'from browser_use import Agent, Browser, Controller, ActionModel, ActionResult'-diff --cc .github/workflows/lint.ymlindex 9271d97cf,792ef06d0..d7866cb72--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@@ -1,24 -1,38 +1,44 @@@--name: Lint++name: linton:push:++ branches:++ - main++ - stable++ - 'releases/**'++ tags:++ - '*'pull_request:++ branches:++ - main++ - stable++ - 'releases/**'workflow_dispatch:+jobs:- ruff:+ lint-syntax:- name: Syntax++ name: syntax-errorsruns-on: ubuntu-latest++ if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork))+ steps:+ - uses: actions/checkout@v4- - name: Setup uv and cache packages- uses: astral-sh/setup-uv@v5++ - uses: astral-sh/setup-uv@v5+ - run: uv run ruff check --no-fix --select PLE++ lint-style:- name: Style++ name: code-style+ runs-on: ubuntu-latest++ if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork))steps:- uses: actions/checkout@v4- - name: Setup uv and cache packages- uses: astral-sh/setup-uv@v5+ - uses: astral-sh/setup-uv@v5- run: uv run ruff format- run: uv run pre-commit run --all-files- # TODO: Fix the ignored pytests.- # openai.OpenAIError: The api_key client option must be set either by passing- # api_key to the client or by setting the OPENAI_API_KEY environment variable- - run: uv run --with=dotenv pytest- --ignore=tests/test_dropdown_error.py- --ignore=tests/test_gif_path.py- --ignore=tests/test_models.py- --ignore=tests/test_react_dropdown.py- --ignore=tests/test_save_conversation.py- --ignore=tests/test_vision.py- --ignore=tests/test_wait_for_element.py || true++ lint-typecheck:- name: pyright++ name: type-checker+ runs-on: ubuntu-latest++ if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork))+ steps:+ - uses: actions/checkout@v4- - name: Setup uv and cache packages- uses: astral-sh/setup-uv@v5++ - uses: astral-sh/setup-uv@v5+ - run: uv run pyright----diff --cc .github/workflows/publish.ymlindex 77cb46bf5,77cb46bf5..98f9f2169--- a/.github/workflows/publish.yml+++ b/.github/workflows/publish.yml@@@ -6,46 -6,46 +6,19 @@@# separate terms of service, privacy policy, and support# documentation.--name: Python Package Workflow++name: publishon:-- push:-- branches:-- - mainrelease:-- types: [published]++ types: [published] # publish full release to PyPI when a release is created on Githubschedule:-- - cron: "0 17 * * FRI" # Every Friday at 5 PM UTC++ - cron: "0 17 * * FRI" # tag a pre-release on Github every Friday at 5 PM UTCpermissions:contents: writeid-token: writejobs:-- pre_commit_and_tests:-- if: github.event_name == 'push' && github.ref_name == 'main'-- runs-on: ubuntu-latest-- steps:-- - uses: actions/checkout@v4-- - name: Set up Python-- uses: actions/setup-python@v5-- with:-- python-version: "3.x"-- - uses: astral-sh/setup-uv@v5-- - run: uv run ruff check --no-fix --select PLE # check only for syntax errors-- - run: uv build-- - run: uv run --isolated --no-project --with pytest --with dist/*.whl tests/conftest.py-- - run: uv run --isolated --no-project --with pytest --with dist/*.tar.gz tests/conftest.py-- - run: uv run --with=dotenv pytest \-- --ignore=tests/test_dropdown_error.py \-- --ignore=tests/test_gif_path.py \-- --ignore=tests/test_models.py \-- --ignore=tests/test_react_dropdown.py \-- --ignore=tests/test_save_conversation.py \-- --ignore=tests/test_vision.py \-- --ignore=tests/test_wait_for_element.py || true-- # - run: uv publish --trusted-publishing always--tag_pre_release:if: github.event_name == 'schedule'runs-on: ubuntu-latest@@@ -63,7 -63,7 +36,7 @@@git tag $new_taggit push origin $new_tag-- deploy:++ publish_to_pypi:if: github.event_name == 'release'runs-on: ubuntu-lateststeps:diff --cc .github/workflows/test.yamlindex 000000000,fdf943325..f8f94216bmode 000000,100644..100644--- a/.github/workflows/test.yaml+++ b/.github/workflows/test.yaml@@@ -1,0 -1,36 +1,50 @@@-name: Test++name: test+++ on:+ push:++ branches:++ - main++ - stable++ - 'releases/**'++ tags:++ - '*'+ pull_request:++ branches:++ - main++ - stable++ - 'releases/**'+ workflow_dispatch:++ jobs:+ tests:+ name: ${{matrix.test}}+ runs-on: ubuntu-latest++ if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork))+ strategy:+ matrix:+ test:- - browser/builtin_patchright- - browser/user_binary- - browser/cdp- - models/openai- - models/google- - models/anthropic- # - models/azure # (requires AZURE_OPENAI_API_KEY set)- # - models/deepseek # (requires DEEPSEEK_API_KEY set)- # - models/grok # (requires GROK_API_KEY set)- # - functionality/click- # - functionality/tabs- # - functionality/input++ - tests/browser/patchright++ - tests/browser/user_binary++ - tests/browser/remote_cdp++ - tests/models/openai++ - tests/models/google++ - tests/models/anthropic++ - tests/models/azure++ - tests/models/deepseek++ - tests/models/grok++ - tests/functionality/click++ - tests/functionality/tabs++ - tests/functionality/input++ - tests/functionality/scroll++ - tests/functionality/upload++ - tests/functionality/download++ - tests/functionality/save++ - tests/functionality/vision++ - tests/functionality/memory++ - tests/functionality/planner++ - tests/functionality/hooks++ steps:+ - uses: actions/checkout@v4- - name: Setup uv and cache packages- uses: astral-sh/setup-uv@v5- - name: Run ${{ matrix.test }} test- run: uv run --with=dotenv pytest tests/${{ matrix.test }}.py || true----++ - uses: astral-sh/setup-uv@v5++ - run: uv run --with=dotenv pytest ${{ matrix.test }}.py || true