diff --git a/.github/actions/setup-playwright/action.yml b/.github/actions/setup-playwright/action.yml index b97c953f4a..0b642ecb00 100644 --- a/.github/actions/setup-playwright/action.yml +++ b/.github/actions/setup-playwright/action.yml @@ -102,4 +102,18 @@ runs: - name: Install Playwright browsers if: ${{ steps.preinstalled-playwright.outputs.enabled != 'true' }} shell: bash - run: ${{ inputs.install-command }} + env: + INSTALL_COMMAND: ${{ inputs.install-command }} + PACKAGE_JSON_PATH: ${{ inputs.package-json-path }} + RUNNER_LABELS_JSON: ${{ inputs.runner-labels }} + run: | + case "$RUNNER_LABELS_JSON" in + *"blacksmith-"*"ubuntu-2404"*) + package_dir="${PACKAGE_JSON_PATH%/*}" + echo "Using Blacksmith Ubuntu runner OS dependencies; installing Playwright browser binaries only." + pnpm -C "$package_dir" exec playwright install chromium + ;; + *) + bash -o pipefail -c "$INSTALL_COMMAND" + ;; + esac diff --git a/e2e/tests/actions-cache-workflows.test.ts b/e2e/tests/actions-cache-workflows.test.ts index a0b48155f0..e8c4201139 100644 --- a/e2e/tests/actions-cache-workflows.test.ts +++ b/e2e/tests/actions-cache-workflows.test.ts @@ -21,11 +21,13 @@ describe("GitHub Actions cache workflows", () => { const action = await readFile(setupPlaywrightAction, "utf8"); expect(action).toContain("*'\"nexu-runners-'*"); + expect(action).toContain('*"blacksmith-"*"ubuntu-2404"*)'); expect(action).toContain("PLAYWRIGHT_BROWSERS_PATH"); expect(action).toContain("steps.preinstalled-playwright.outputs.enabled == 'true'"); expect(action).toContain("steps.preinstalled-playwright.outputs.enabled != 'true'"); expect(action).toContain('pnpm -C "$package_dir" exec playwright install chromium'); - expect(action).toContain("run: ${{ inputs.install-command }}"); + expect(action).toContain("Using Blacksmith Ubuntu runner OS dependencies"); + expect(action).toContain('bash -o pipefail -c "$INSTALL_COMMAND"'); }); it("[P1] keeps pnpm cache writes on explicit trusted main seed jobs", async () => {