Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/scripts/http-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ wait_for_browsers() {
exit 1
fi
browsers_pid=''
tail -n 1 "$browsers_log"
}

# start_app <name> <port> <label> [record-http-status]
Expand Down Expand Up @@ -197,7 +198,7 @@ case "$group" in
export WORKFLOW_CODE=true
export PEOPLE=true
export CRON_SECRET=people-directory-sync-local-e2e-secret
start_browser_install people chromium
start_browser_install people --only-shell chromium
start_app scim 3017 SCIM record-http-status
wait_for_browsers
export PEOPLE_E2E_SCREENSHOT_DIR="$report_dir/people-ui-report.json.artifacts"
Expand Down
7 changes: 6 additions & 1 deletion .github/scripts/install-playwright.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# The dependency dry run uses the pinned driver's package list without updating apt.
# Browsers restored from the job's ms-playwright cache make `playwright install` a no-op.
set -euo pipefail

browsers=()
Expand All @@ -10,7 +11,11 @@ for argument in "$@"; do
esac
done

started=$SECONDS
if ! bunx --no-install playwright install-deps --dry-run "${browsers[@]}"; then
bunx --no-install playwright install-deps "${browsers[@]}"
fi
exec bunx --no-install playwright install "$@"
deps_seconds=$((SECONDS - started))
started=$SECONDS
bunx --no-install playwright install "$@"
echo "Playwright system dependencies took ${deps_seconds}s and browsers $((SECONDS - started))s ($*)"
19 changes: 19 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,22 @@ jobs:
with:
provider: github

# Browser groups download Playwright's browsers in the background while the app boots, and
# the suite waits on that download (up to two minutes for full Chromium). Push validation on
# the base branch seeds this cache for pull requests.
- &resolve-playwright
name: Resolve the Playwright version
id: playwright
if: &browser-group contains(fromJSON('["scim","assistant-actions","organization-search","markdown-viewer","workflow-code-ui","mobile"]'), matrix.group) || startsWith(matrix.group, 'browser-extension-')
run: echo "version=$(bunx --no-install playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- &cache-playwright
name: Cache Playwright browsers
if: *browser-group
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ steps.playwright.outputs.version }}-${{ matrix.browser || matrix.group }}

# Migrations create their own extensions, as on a fresh self-hosted install.
- name: Provision the database through migrations
if: matrix.group != 'project-files'
Expand Down Expand Up @@ -370,6 +386,9 @@ jobs:
with:
provider: ${{ vars.CI_PROVIDER }}

- *resolve-playwright
- *cache-playwright

- name: Provision the database through migrations
working-directory: packages/db
run: bun run db:migrate
Expand Down
Loading