Files
EpicNext-Cms/src/lib/ci-workflow-contract.test.ts
T
SimoandCursor 3e584aadaf
CI / check (push) Successful in 25s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m8s
ci: unify check and production deploy into one workflow
Co-authored-by: Cursor <[email protected]>
2026-07-30 20:58:40 +02:00

35 lines
1.1 KiB
TypeScript

import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
describe("CI workflow", () => {
const workflow = readFileSync(
resolve(process.cwd(), ".gitea/workflows/ci.yaml"),
"utf8",
);
it("runs check then production deploy on push to main", () => {
expect(workflow).toContain("pnpm biome:lint");
expect(workflow).toContain("pnpm typecheck");
expect(workflow).toContain("pnpm test");
expect(workflow).toContain("needs: check");
expect(workflow).toContain(
"gitea.event_name == 'push' && gitea.ref_name == 'main'",
);
expect(workflow).toContain("worktree add --detach");
expect(workflow).toContain("/api/health");
expect(workflow).not.toContain("github.ref");
});
it("uses Gitea SHA for check checkout", () => {
expect(workflow).toContain("gitea.sha");
expect(workflow).toContain("SKIP_ENV_VALIDATION=1");
});
it("keeps tag release in the same workflow", () => {
expect(workflow).toContain('tags:\n - "v*"');
expect(workflow).toContain("Creating release for");
expect(workflow).toContain("startsWith(gitea.ref_name, 'v')");
});
});