- Runner hernoemd naar 'Epic runner' - Env variabelen als global env (niet per step) - fetch-depth: 1 voor snellere checkout - Knip verwijderd (traag, niet kritiek) - Docker BuildKit caching - Health check opgeschoond
34 lines
1.1 KiB
TypeScript
34 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",
|
|
).replace(/\r\n/g, "\n");
|
|
|
|
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'");
|
|
expect(workflow).toContain("gitea.ref_name == 'main'");
|
|
expect(workflow).toContain("/api/health");
|
|
expect(workflow).not.toContain("github.ref");
|
|
});
|
|
|
|
it("uses Gitea SHA for check checkout", () => {
|
|
expect(workflow).toContain("SKIP_ENV_VALIDATION");
|
|
});
|
|
|
|
it("includes tag triggers", () => {
|
|
expect(workflow).toContain('tags:\n - "v*"');
|
|
});
|
|
|
|
it("sets test environment variables as global env", () => {
|
|
expect(workflow).toContain("SKIP_ENV_VALIDATION: 1");
|
|
});
|
|
});
|