mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
ci: avoid slow Ubuntu mirrors during WebKit setup (#32205)
* ci: reuse bounded Ubuntu mirror setup for WebKit * ci: preserve Ubuntu setup for dispatched older refs
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# GitHub's mirror+file sources resolve through apt-mirrors.txt, not just sources.list.
|
||||
for source in /etc/apt/apt-mirrors.txt /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
if [ -f "$source" ]; then
|
||||
sudo sed -i 's|https*://azure\.archive\.ubuntu\.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' "$source"
|
||||
fi
|
||||
done
|
||||
sudo tee /etc/apt/apt.conf.d/99-orca-ci >/dev/null <<'APTCONF'
|
||||
Acquire::http::Timeout "15";
|
||||
Acquire::https::Timeout "15";
|
||||
Acquire::Retries "1";
|
||||
APTCONF
|
||||
@@ -88,17 +88,21 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
read -r -a packages <<< "$ORCA_E2E_APT_PACKAGES"
|
||||
# Why apt-mirrors.txt: runner images resolve mirror+file: sources through it, so editing the lists alone leaves Azure in use.
|
||||
for source in /etc/apt/apt-mirrors.txt /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
if [ -f "$source" ]; then
|
||||
sudo sed -i 's|https*://azure\.archive\.ubuntu\.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' "$source"
|
||||
fi
|
||||
done
|
||||
sudo tee /etc/apt/apt.conf.d/99-orca-e2e >/dev/null <<'APTCONF'
|
||||
if [ -f .github/scripts/prepare-ubuntu-apt.sh ]; then
|
||||
bash .github/scripts/prepare-ubuntu-apt.sh
|
||||
else
|
||||
# Dispatched refs can predate the shared preparation script.
|
||||
for source in /etc/apt/apt-mirrors.txt /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
if [ -f "$source" ]; then
|
||||
sudo sed -i 's|https*://azure\.archive\.ubuntu\.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' "$source"
|
||||
fi
|
||||
done
|
||||
sudo tee /etc/apt/apt.conf.d/99-orca-ci >/dev/null <<'APTCONF'
|
||||
Acquire::http::Timeout "15";
|
||||
Acquire::https::Timeout "15";
|
||||
Acquire::Retries "1";
|
||||
APTCONF
|
||||
fi
|
||||
timeout 120 sudo apt-get update
|
||||
timeout 300 sudo apt-get install -y "${packages[@]}" || timeout 300 sudo apt-get install -y --fix-missing "${packages[@]}"
|
||||
|
||||
|
||||
@@ -939,7 +939,9 @@ jobs:
|
||||
- name: Install WebKit for the drawer check
|
||||
id: webkit
|
||||
background: true
|
||||
run: pnpm exec playwright-core install --with-deps webkit
|
||||
run: |
|
||||
bash .github/scripts/prepare-ubuntu-apt.sh
|
||||
pnpm exec playwright-core install --with-deps webkit
|
||||
|
||||
# The entry lives in mobile/ so one React resolves; without this every RN import is nothing.
|
||||
- uses: ./.github/actions/install-mobile-dependencies
|
||||
|
||||
@@ -173,6 +173,7 @@ const DEPENDENCY_ISOLATION_PREFIXES = [
|
||||
]
|
||||
|
||||
const MOBILE_WEB_APP_PREFIXES = [
|
||||
'.github/scripts/prepare-ubuntu-apt.sh',
|
||||
'config/scripts/build-mobile-web-app',
|
||||
'config/scripts/run-mobile-web-app-checks',
|
||||
'src/packages/process-host/',
|
||||
|
||||
@@ -520,6 +520,7 @@ export function selectPrE2eSpecs(
|
||||
(file.startsWith('tests/e2e/helpers/') &&
|
||||
[...specs].some((spec) => spec.startsWith(MANAGED_SSH_E2E_SPEC_PREFIX))) ||
|
||||
file === '.github/workflows/e2e.yml' ||
|
||||
file === '.github/scripts/prepare-ubuntu-apt.sh' ||
|
||||
file === 'config/scripts/ci-e2e-job-selection.mjs'
|
||||
)
|
||||
) {
|
||||
|
||||
@@ -62,6 +62,7 @@ const LAYOUT_ORACLE_PREFIXES = [
|
||||
'.github/scripts/e2e-with-window-manager.sh',
|
||||
// The job itself: the called workflow, its window-spec lane picker, and this route.
|
||||
'.github/workflows/e2e.yml',
|
||||
'.github/scripts/prepare-ubuntu-apt.sh',
|
||||
'config/scripts/ci-e2e-job-selection.mjs',
|
||||
'config/scripts/pr-layout-oracle-route.mjs'
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user