Skip to content

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

Enhance GitHub workflows by adding Playwright version detection and updating cache keys for Chromium binaries based on the installed Playwright version.

Magnus Müller633fb53b1aa8
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 5d6d71d98..16942518e 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -92,12 +92,21 @@ 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')
+ 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 }}-chromium-browser
+ key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium
+ restore-keys: |
+ ${{ runner.os }}-${{ runner.arch }}-playwright-
- name: Install Chromium browser
run: uvx playwright install chromium --with-deps --no-shell
@@ -147,12 +156,21 @@ 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')
+ 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 }}-chromium-browser
+ key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright-version.outputs.version }}-chromium
+ restore-keys: |
+ ${{ runner.os }}-${{ runner.arch }}-playwright-
- name: Install Chromium browser
run: uvx playwright install chromium --with-deps --no-shell