2026-04-06 02:07:17 +00:00
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
|
import { readFileSync } from "node:fs";
|
|
|
|
|
import path from "node:path";
|
|
|
|
|
|
|
|
|
|
const root = process.cwd();
|
|
|
|
|
|
|
|
|
|
const readFile = (rel: string) => readFileSync(path.resolve(root, rel), "utf-8");
|
|
|
|
|
|
|
|
|
|
// ─── Dockerfiles ─────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
describe("Dockerfile.linux-amd64", () => {
|
|
|
|
|
const df = readFile(".docker/Dockerfile.linux-amd64");
|
|
|
|
|
|
|
|
|
|
it("is based on the pinned Rust 1.88 slim image", () => {
|
|
|
|
|
expect(df).toContain("FROM rust:1.88-slim");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs webkit2gtk 4.1 dev package", () => {
|
|
|
|
|
expect(df).toContain("libwebkit2gtk-4.1-dev");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs Node.js 22 via NodeSource", () => {
|
|
|
|
|
expect(df).toContain("nodesource.com/setup_22.x");
|
|
|
|
|
expect(df).toContain("nodejs");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("pre-adds the x86_64 Linux Rust target", () => {
|
|
|
|
|
expect(df).toContain("rustup target add x86_64-unknown-linux-gnu");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("cleans apt lists to keep image lean", () => {
|
|
|
|
|
expect(df).toContain("rm -rf /var/lib/apt/lists/*");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe("Dockerfile.windows-cross", () => {
|
|
|
|
|
const df = readFile(".docker/Dockerfile.windows-cross");
|
|
|
|
|
|
|
|
|
|
it("is based on the pinned Rust 1.88 slim image", () => {
|
|
|
|
|
expect(df).toContain("FROM rust:1.88-slim");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs mingw-w64 cross-compiler", () => {
|
|
|
|
|
expect(df).toContain("mingw-w64");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs nsis for Windows installer bundling", () => {
|
|
|
|
|
expect(df).toContain("nsis");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs Node.js 22 via NodeSource", () => {
|
|
|
|
|
expect(df).toContain("nodesource.com/setup_22.x");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("pre-adds the Windows GNU Rust target", () => {
|
|
|
|
|
expect(df).toContain("rustup target add x86_64-pc-windows-gnu");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("cleans apt lists to keep image lean", () => {
|
|
|
|
|
expect(df).toContain("rm -rf /var/lib/apt/lists/*");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe("Dockerfile.linux-arm64", () => {
|
|
|
|
|
const df = readFile(".docker/Dockerfile.linux-arm64");
|
|
|
|
|
|
|
|
|
|
it("is based on Ubuntu 22.04 (Jammy)", () => {
|
|
|
|
|
expect(df).toContain("FROM ubuntu:22.04");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs aarch64 cross-compiler", () => {
|
|
|
|
|
expect(df).toContain("gcc-aarch64-linux-gnu");
|
|
|
|
|
expect(df).toContain("g++-aarch64-linux-gnu");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("sets up arm64 multiarch via ports.ubuntu.com", () => {
|
|
|
|
|
expect(df).toContain("dpkg --add-architecture arm64");
|
|
|
|
|
expect(df).toContain("ports.ubuntu.com/ubuntu-ports");
|
|
|
|
|
expect(df).toContain("jammy");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs arm64 webkit2gtk dev package", () => {
|
|
|
|
|
expect(df).toContain("libwebkit2gtk-4.1-dev:arm64");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs Rust 1.88 with arm64 cross-compilation target", () => {
|
|
|
|
|
expect(df).toContain("--default-toolchain 1.88.0");
|
|
|
|
|
expect(df).toContain("rustup target add aarch64-unknown-linux-gnu");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("adds cargo to PATH via ENV", () => {
|
|
|
|
|
expect(df).toContain('ENV PATH="/root/.cargo/bin:${PATH}"');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("installs Node.js 22 via NodeSource", () => {
|
|
|
|
|
expect(df).toContain("nodesource.com/setup_22.x");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ─── build-images.yml workflow ───────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
describe("build-images.yml workflow", () => {
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
const wf = readFile(".github/workflows/build-images.yml");
|
2026-04-06 02:07:17 +00:00
|
|
|
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
it("triggers on changes to .docker/ files on main", () => {
|
|
|
|
|
expect(wf).toContain("- main");
|
2026-04-06 02:07:17 +00:00
|
|
|
expect(wf).toContain("- '.docker/**'");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("supports manual workflow_dispatch trigger", () => {
|
|
|
|
|
expect(wf).toContain("workflow_dispatch:");
|
|
|
|
|
});
|
|
|
|
|
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
it("authenticates to ghcr.io before pushing", () => {
|
|
|
|
|
expect(wf).toContain("docker login ghcr.io");
|
2026-04-06 02:07:17 +00:00
|
|
|
expect(wf).toContain("--password-stdin");
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
expect(wf).toContain("ghcr.io");
|
2026-04-06 02:07:17 +00:00
|
|
|
});
|
|
|
|
|
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
it("builds and pushes all three platform images to ghcr.io", () => {
|
|
|
|
|
expect(wf).toContain("ghcr.io/msicie/trcaa-linux-amd64:rust1.88-node22");
|
|
|
|
|
expect(wf).toContain("ghcr.io/msicie/trcaa-windows-cross:rust1.88-node22");
|
|
|
|
|
expect(wf).toContain("ghcr.io/msicie/trcaa-linux-arm64:rust1.88-node22");
|
2026-04-06 02:07:17 +00:00
|
|
|
});
|
|
|
|
|
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
it("runs all three build jobs on ubuntu-latest runner", () => {
|
|
|
|
|
const matches = wf.match(/runs-on: ubuntu-latest/g) ?? [];
|
|
|
|
|
expect(matches.length).toBeGreaterThanOrEqual(3);
|
2026-04-06 02:07:17 +00:00
|
|
|
});
|
|
|
|
|
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
it("uses GITHUB_TOKEN for registry auth", () => {
|
|
|
|
|
expect(wf).toContain("secrets.GITHUB_TOKEN");
|
2026-04-06 02:07:17 +00:00
|
|
|
});
|
|
|
|
|
|
docs: remove all Gitea/Gogs/172.0.0.29 references; update to GitHub
Replace every remaining reference to the old Gitea infrastructure with the
new GitHub-hosted equivalents across all documentation, wiki pages, test
files, and historical ticket summaries.
- README.md: CI badge, clone URL, releases link, CI/CD section, project structure
- docs/wiki/CICD-Pipeline.md: full rewrite for GitHub Actions + ghcr.io
- docs/wiki/Home.md: CI badge, releases link, phase status, tech stack
- docs/wiki/Troubleshooting.md: rewrite CI troubleshooting for GitHub Actions
- docs/architecture/README.md: update CI/CD pipeline diagram
- AGENTS.md: CI/CD section, environment references
- PLAN.md: directory structure, pipeline table
- SECURITY_AUDIT.md: mark C3 and L4 findings as resolved
- ticket-git-cliff-changelog.md: workflow path updated
- tickets/ci-runner-speed-optimization.md: image registry updated
- 2026-hackathon_AgenticFeature.md: workflow path updated
- tests: workflow path assertions updated in all three test files
2026-06-01 21:18:34 +00:00
|
|
|
it("grants packages write permission", () => {
|
|
|
|
|
expect(wf).toContain("packages: write");
|
2026-04-06 02:07:17 +00:00
|
|
|
});
|
|
|
|
|
});
|