From 3bb6becb5ac09fa2eea30b4e04f9e153f1c8e538 Mon Sep 17 00:00:00 2001 From: dha-aa <172045152+dha-aa@users.noreply.github.com> Date: Sun, 27 Apr 2025 08:27:07 +0000 Subject: [PATCH] build once with Python 3.12, test imports across OS/Python matrix --- .github/workflows/build.yaml | 44 ++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 22392aada..3ac553301 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build +name: Build and Test on: push: pull_request: @@ -6,28 +6,54 @@ on: jobs: build: + name: Build Package + runs-on: ubuntu-latest + 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 }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.11", "3.12", "3.13"] + steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Setup uv and cache packages uses: astral-sh/setup-uv@v5 - - run: uv build - - name: Set up isolated venv and test import + + - 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 + 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 dist/*.whl - python -c "import browser_use; print('browser_use package is imported and functional!')" + uv pip install *.whl + python -c 'from browser_use import Agent, Browser, Controller, ActionModel, ActionResult' +