Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix(ci): prepare platform media tools without parsing upstream readmes

kashorin28ae485bbc67
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 91d59709..480bdf85 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,8 +54,20 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- - name: Install ffmpeg
- uses: FedericoCarboni/setup-ffmpeg@v3
+ - name: Install ffmpeg on Linux
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y ffmpeg
+
+ - name: Install ffmpeg on Windows
+ if: runner.os == 'Windows'
+ run: choco install ffmpeg --yes --no-progress
+
+ - name: Inspect the installed media tools
+ run: |
+ ffmpeg -version
+ ffprobe -version
- name: Type check
run: pnpm check
diff --git a/packages/media-execution/test/process-env.test.ts b/packages/media-execution/test/process-env.test.ts
index f0afe3e2..aeefc66a 100644
--- a/packages/media-execution/test/process-env.test.ts
+++ b/packages/media-execution/test/process-env.test.ts
@@ -1,5 +1,6 @@
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
+import { basename } from "node:path";
import test from "node:test";
import { mediaProcessEnv } from "../src/process-env.js";
@@ -15,7 +16,7 @@ test("media processes inherit PATH without the rest of the Host environment", ()
if (process.env.SYSTEMROOT !== undefined) assert.equal(env.SYSTEMROOT, process.env.SYSTEMROOT);
if (process.env.PATHEXT !== undefined) assert.equal(env.PATHEXT, process.env.PATHEXT);
}
- const report = spawnSync(process.execPath, ["-e", "process.stdout.write(JSON.stringify({ secret: process.env.HYPIT_MEDIA_ENV_PROBE, path: Boolean(process.env.PATH), systemRoot: Boolean(process.env.SYSTEMROOT) }))"], {
+ const report = spawnSync(basename(process.execPath), ["-e", "process.stdout.write(JSON.stringify({ secret: process.env.HYPIT_MEDIA_ENV_PROBE, path: Boolean(process.env.PATH), systemRoot: Boolean(process.env.SYSTEMROOT) }))"], {
env,
encoding: "utf8",
windowsHide: true,
@@ -30,3 +31,13 @@ test("media processes inherit PATH without the rest of the Host environment", ()
else process.env.HYPIT_MEDIA_ENV_PROBE = previous;
}
});
+
+test("media binaries can start by PATH under the reduced media environment", {
+ skip: ["ffmpeg", "ffprobe"].some(command => spawnSync(command, ["-version"], { stdio: "ignore", windowsHide: true }).status !== 0),
+}, () => {
+ for (const command of ["ffmpeg", "ffprobe"]) {
+ const child = spawnSync(command, ["-version"], { env: mediaProcessEnv(), encoding: "utf8", windowsHide: true });
+ assert.equal(child.status, 0, `${command}: ${child.error?.message ?? child.stderr}`);
+ assert.ok(child.stdout.startsWith(`${command} version`));
+ }
+});