refactor(ci): move GitHub automation scripts under scripts/ci
The repository had three script roots with three test entry points. The automation scripts now live in scripts/ci and run through scripts/test.mjs, which gained a quick automation profile and includes them in the ci and release profiles. The workflows keep checking the scripts out from the workflow commit, never from the PR branch. stateKey now returns its fallback explicitly, because the file is inside the empty-catch guard once it sits under scripts/. The review and diagnosis exclude lists also skip the generated frontend wordmark module.
This commit is contained in:
1 parent
bd7c9abaa3
commit
87e7ac8774
15 files changed
+25
-17
No files matched your search
+9
-2
@@ -8,12 +8,16 @@ import { createTemporaryFiles } from './debug/temporary-files.mjs'
|
||||
|
||||
const frontend = path.join(REPO_ROOT, 'frontend')
|
||||
const goTrees = ['./cmd/...', './internal/...', './pkg/...', './scripts/...']
|
||||
const ciTests = fs.readdirSync(path.join(REPO_ROOT, 'scripts', 'ci'))
|
||||
.filter((name) => name.endsWith('.test.mjs'))
|
||||
.sort()
|
||||
.map((name) => path.join('scripts', 'ci', name))
|
||||
const hostInputs = [
|
||||
'REIMS_GO_TEST_CTL', 'REIMS_GO_TEST_QEMU_IMG', 'REIMS_GO_TEST_OPENCORE', 'REIMS_GO_TEST_OFFLINE_IMG',
|
||||
]
|
||||
const usage = `Usage: node scripts/test.mjs <profile>
|
||||
quick go ./internal/<package> [./pkg/<package> ...]
|
||||
quick frontend | storage | tooling
|
||||
quick frontend | storage | tooling | automation
|
||||
ci
|
||||
release
|
||||
webview2 <windows-executable>
|
||||
@@ -49,7 +53,7 @@ function select(args) {
|
||||
}
|
||||
return { profile, area, packages }
|
||||
}
|
||||
if (['frontend', 'storage', 'tooling'].includes(area) && packages.length === 0) return { profile, area }
|
||||
if (['frontend', 'storage', 'tooling', 'automation'].includes(area) && packages.length === 0) return { profile, area }
|
||||
throw new Error(usage)
|
||||
}
|
||||
|
||||
@@ -85,6 +89,7 @@ async function main(args) {
|
||||
const go = (targets, flags = []) => run('Go', 'go', ['test', '-timeout=5m', `-p=${jobs}`, ...flags, ...targets], env)
|
||||
const front = (script) => run(`Frontend ${script}`, process.execPath, ['--run', script], env, frontend)
|
||||
const tooling = () => run('Tooling', process.execPath, ['--test', 'scripts/debug/debug.test.mjs'], env)
|
||||
const automation = () => run('GitHub automation', process.execPath, ['--test', ...ciTests], env)
|
||||
|
||||
if (profile === 'webview2') {
|
||||
if (process.platform !== 'win32') throw new Error('WebView2 smoke requires Windows')
|
||||
@@ -99,12 +104,14 @@ async function main(args) {
|
||||
}
|
||||
if (area === 'frontend') await front('test')
|
||||
if (area === 'tooling') await tooling()
|
||||
if (area === 'automation') await automation()
|
||||
} else {
|
||||
await front('test')
|
||||
await front('typecheck')
|
||||
const flags = profile === 'release' ? ['-count=1', '-shuffle=on', '-tags=desktop,production'] : []
|
||||
await go(goTrees, ['-vet=all', ...flags])
|
||||
await tooling()
|
||||
await automation()
|
||||
}
|
||||
|
||||
files.close(directory)
|
||||
|
||||
Reference in new issue
Block a user