Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

ci: use reachable Ubuntu mirror for Playwright dependencies

Amruth Pillaif1d5c6bab440
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index bc9ad94e7..22bb5f75e 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -57,7 +57,13 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Install Playwright Browser
- run: pnpm exec playwright install --with-deps chromium
+ timeout-minutes: 10
+ run: |
+ # The runner's Ubuntu archive/security mirrors time out during dependency installation.
+ printf '%s\n' 'https://mirrors.edge.kernel.org/ubuntu/' | sudo tee /etc/apt/blacksmith-ubuntu-mirrors.txt > /dev/null
+ sudo find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) \
+ -exec sed -i -E 's#https?://(archive|us\.archive|security)\.ubuntu\.com/ubuntu#https://mirrors.edge.kernel.org/ubuntu#g' {} +
+ pnpm exec playwright install --with-deps chromium
- name: Generate Test Secrets
run: |
diff --git a/tooling/playwright-mirrors.test.ts b/tooling/playwright-mirrors.test.ts
new file mode 100644
index 000000000..b12ccd8a4
--- /dev/null
+++ b/tooling/playwright-mirrors.test.ts
@@ -0,0 +1,24 @@
+import { execFileSync } from "node:child_process";
+import { readFileSync } from "node:fs";
+import { expect, it } from "vitest";
+
+it("rewrites Ubuntu APT sources while preserving unrelated repositories and signature settings", () => {
+ const workflow = readFileSync(new URL("../.github/workflows/e2e.yml", import.meta.url), "utf8");
+ const expression = workflow.match(/-exec sed -i -E '([^']+)'/)?.[1];
+ if (!expression) throw new Error("Ubuntu mirror rewrite is missing");
+ const input = [
+ "deb http://archive.ubuntu.com/ubuntu noble main",
+ "URIs: http://us.archive.ubuntu.com/ubuntu/",
+ "URIs: https://security.ubuntu.com/ubuntu/",
+ "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg",
+ "URIs: mirror+file:/etc/apt/blacksmith-ubuntu-mirrors.txt",
+ "deb https://packages.microsoft.com/ubuntu/24.04/prod noble main",
+ ].join("\n");
+ const output = execFileSync("sed", ["-E", expression], { input, encoding: "utf8" });
+ expect(output.trimEnd()).toBe(
+ input
+ .replace("http://archive.ubuntu.com/ubuntu", "https://mirrors.edge.kernel.org/ubuntu")
+ .replace("http://us.archive.ubuntu.com/ubuntu", "https://mirrors.edge.kernel.org/ubuntu")
+ .replace("https://security.ubuntu.com/ubuntu", "https://mirrors.edge.kernel.org/ubuntu"),
+ );
+});