ci: split test workflow across shards
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -3,19 +3,30 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { readFileSync } from "node:fs"
|
||||
|
||||
const workflowPaths = [
|
||||
new URL("../.github/workflows/ci.yml", import.meta.url),
|
||||
new URL("../.github/workflows/publish.yml", import.meta.url),
|
||||
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",
|
||||
"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"],
|
||||
},
|
||||
]
|
||||
|
||||
describe("test workflows", () => {
|
||||
test("use pure bun test for workflows", () => {
|
||||
for (const workflowPath of workflowPaths) {
|
||||
for (const workflowCheck of workflowChecks) {
|
||||
// #given
|
||||
const workflow = readFileSync(workflowPath, "utf8")
|
||||
const workflow = readFileSync(workflowCheck.path, "utf8")
|
||||
|
||||
expect(workflow).toContain("- name: Run tests")
|
||||
expect(workflow).toMatch(/run: bun (test|run script\/run-ci-tests\.ts)/)
|
||||
for (const testRun of workflowCheck.testRuns) {
|
||||
expect(workflow).toContain(testRun)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user