Files
oh-my-opencode/script/publish-workflow.test.ts
T

37 lines
1.2 KiB
TypeScript
Raw Normal View History

/// <reference types="bun-types" />
2026-04-04 01:51:48 +09:00
import { describe, expect, test } from "bun:test"
import { readFileSync } from "node:fs"
2026-05-15 11:41:35 +09:00
const workflowChecks = [
{
path: new URL("../.github/workflows/ci.yml", import.meta.url),
testRuns: [
"run: bun run script/run-ci-tests.ts --phase=isolated --shard-count=4 --shard-index=${{ matrix.shard }}",
"run: bun run script/run-ci-tests.ts --phase=shared",
2026-05-15 12:07:58 +09:00
"if: ${{ always() }}",
"ISOLATED_RESULT: ${{ needs.test-isolated.result }}",
"SHARED_RESULT: ${{ needs.test-shared.result }}",
"echo \"::error::test-isolated=${ISOLATED_RESULT}, test-shared=${SHARED_RESULT}\"",
2026-05-15 11:41:35 +09:00
"run: bun test src/shared/dist-bundle-bun-globals.test.ts",
],
},
{
path: new URL("../.github/workflows/publish.yml", import.meta.url),
testRuns: ["run: bun run script/run-ci-tests.ts"],
},
2026-04-04 01:51:48 +09:00
]
describe("test workflows", () => {
2026-04-06 18:45:33 +09:00
test("use pure bun test for workflows", () => {
2026-05-15 11:41:35 +09:00
for (const workflowCheck of workflowChecks) {
// #given
2026-05-15 11:41:35 +09:00
const workflow = readFileSync(workflowCheck.path, "utf8")
2026-04-04 01:51:48 +09:00
2026-05-15 11:41:35 +09:00
for (const testRun of workflowCheck.testRuns) {
expect(workflow).toContain(testRun)
}
2026-04-04 01:51:48 +09:00
}
})
})