Skip to content
Merged
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
56 changes: 36 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ jobs:
run: node scripts/sync-effect-source.ts --check

- name: Typecheck
run: vp exec vp run -r --concurrency-limit 2 typecheck
# Typecheck runs before build against .ts sources directly, so packages
# don't need topological ordering (`apps/server` lists `@threadlines/web`
# only to bundle its dist output).
run: vp exec vp run --parallel --concurrency-limit 4 --filter '!@threadlines/monorepo' typecheck

- name: Build desktop pipeline
run: vp exec vp run build:desktop
Expand Down Expand Up @@ -197,27 +200,40 @@ jobs:
- name: Install dependencies
run: vp install --frozen-lockfile

# Hosted runners point apt at azure.archive.ubuntu.com, which
# intermittently stalls for 20+ minutes and starves the job timeout.
# Plain HTTP to archive.ubuntu.com can stall too (every request waited
# 30 s on 2026-10-07 while HTTPS answered at once), so Ubuntu's archive
# is fetched over HTTPS, and a stuck connection gives up after 10 s and
# retries once. Ubuntu 24.04 keeps the active mirror in apt-mirrors.txt,
# while older images use .list or .sources files, so update every
# supported format. The config file sorts last so the image's own
# settings can't override it.
- name: Use main Ubuntu mirror for apt, over HTTPS
run: |
sudo find /etc/apt -type f \( -name "*.list" -o -name "*.sources" -o -name "apt-mirrors.txt" \) \
-exec sed -i -E 's|https?://(azure\.)?archive\.ubuntu\.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' {} +
printf '%s\n' 'Acquire::http::Timeout "10";' 'Acquire::https::Timeout "10";' 'Acquire::Retries "1";' \
| sudo tee /etc/apt/apt.conf.d/zz-threadlines-ci >/dev/null
apt-config dump | grep -E '^Acquire::(Retries|https?::Timeout) '
grep -rhoE 'https?://[a-z.]*ubuntu\.com/ubuntu' /etc/apt | sort | uniq -c

# Hosted ubuntu-latest images already ship Chromium's shared libraries.
# `playwright install --with-deps` spent 2.5 to 5 minutes on throttled
# EC2 Ubuntu mirrors (`*.ec2.archive.ubuntu.com`) fetching optional font
# packages. Install the browser binaries first and only touch apt when a
# real headless launch fails (for example after a future runner image
# drops a library). When apt is needed, rewrite all Ubuntu mirror hosts
# (azure., *.ec2., etc.) to archive.ubuntu.com over HTTPS with a 10 s
# timeout and 1 retry so a stuck mirror cannot starve the job.
- name: Install browser test runtime
timeout-minutes: 10
run: vp exec vp run --filter @threadlines/web test:browser:install
shell: bash
run: |
set -euo pipefail
./apps/web/node_modules/.bin/playwright install chromium
probe_chromium() {
node --input-type=module -e '
import { chromium } from "./apps/web/node_modules/playwright/index.mjs";
const browser = await chromium.launch({ headless: true });
await browser.close();
'
}
if probe_chromium; then
echo "Chromium launched with preinstalled system libraries; skipping apt."
else
echo "Chromium launch failed; installing system dependencies via apt over HTTPS."
sudo find /etc/apt -type f \( -name "*.list" -o -name "*.sources" -o -name "apt-mirrors.txt" \) \
-exec sed -i -E 's|https?://([a-z0-9.-]+\.)?archive\.ubuntu\.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' {} +
printf '%s\n' 'Acquire::http::Timeout "10";' 'Acquire::https::Timeout "10";' 'Acquire::Retries "1";' \
| sudo tee /etc/apt/apt.conf.d/zz-threadlines-ci >/dev/null
apt-config dump | grep -E '^Acquire::(Retries|https?::Timeout) ' || true
grep -rhoE 'https?://[a-z0-9.-]*ubuntu\.com/ubuntu' /etc/apt 2>/dev/null | sort | uniq -c || true
./apps/web/node_modules/.bin/playwright install-deps chromium
probe_chromium
fi

- name: Browser test
env:
Expand Down
Loading
Loading