Skip to content

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

Refactor GitHub workflows to remove Playwright version detection and update cache keys for Chromium binaries based on `uv.lock` file.

Magnus Müllera2b0f084bed2
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 5603bbed7..dde010ad6 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -92,25 +92,14 @@ jobs:
- run: uv sync --dev --all-extras
- - name: Detect installed Playwright version
- id: playwright-version
- run: |
- PLAYWRIGHT_VERSION=$(uv pip list --format json | jq -r '.[] | select(.name == "playwright") | .version')
- if [ -z "$PLAYWRIGHT_VERSION" ]; then
- echo "❌ ERROR: Failed to detect Playwright version" >&2
- exit 1
- fi
- echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
- echo "✅ Playwright version: $PLAYWRIGHT_VERSION"
-
- name: Cache chromium binaries
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
- key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium
+ key: ${{ runner.os }}-${{ runner.arch }}-chromium-${{ hashFiles('uv.lock') }}
restore-keys: |
- ${{ runner.os }}-${{ runner.arch }}-playwright-
+ ${{ runner.os }}-${{ runner.arch }}-chromium-
- name: Install Chromium browser
run: uvx playwright install chromium --with-deps --no-shell
@@ -160,25 +149,14 @@ jobs:
- run: uv sync --dev --all-extras
- - name: Detect installed Playwright version
- id: playwright-version
- run: |
- PLAYWRIGHT_VERSION=$(uv pip list --format json | jq -r '.[] | select(.name == "playwright") | .version')
- if [ -z "$PLAYWRIGHT_VERSION" ]; then
- echo "❌ ERROR: Failed to detect Playwright version" >&2
- exit 1
- fi
- echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
- echo "✅ Playwright version: $PLAYWRIGHT_VERSION"
-
- name: Cache chromium binaries
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
- key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium
+ key: ${{ runner.os }}-${{ runner.arch }}-chromium-${{ hashFiles('uv.lock') }}
restore-keys: |
- ${{ runner.os }}-${{ runner.arch }}-playwright-
+ ${{ runner.os }}-${{ runner.arch }}-chromium-
- name: Install Chromium browser
run: uvx playwright install chromium --with-deps --no-shell