mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +08:00
Tauri runs the repository beforeBuildCommand during packaging, which invokes build:sidecars again after the explicit sidecar step has already passed. The Windows runner therefore still needs the same Bun compile cache override inside the packaging step so the repeated baseline runtime extraction stays on the runner work drive. Constraint: Tauri beforeBuildCommand re-enters the sidecar build under the packaging step environment. Rejected: Remove beforeBuildCommand from CI | that would diverge CI from normal Tauri packaging behavior. Confidence: high Scope-risk: narrow Directive: Keep explicit sidecar build and Tauri packaging environments in sync when changing desktop workflow target or cache settings. Tested: bun test scripts/pr/release-workflow.test.ts; bun run check:policy Not-tested: GitHub Actions Windows runner rerun after push.
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
import { readFileSync } from 'node:fs'
|
|
|
|
describe('release desktop workflow', () => {
|
|
test('build job runs directly without quality preflight dependency', () => {
|
|
const workflow = readFileSync('.github/workflows/release-desktop.yml', 'utf8')
|
|
|
|
expect(workflow).not.toContain('quality-preflight:')
|
|
expect(workflow).not.toContain('run: bun run quality:gate --mode pr')
|
|
expect(workflow).not.toContain('needs: quality-preflight')
|
|
expect(workflow).toContain('name: Build (${{ matrix.label }})')
|
|
})
|
|
|
|
test('desktop build workflows keep Bun compile cache on the runner work drive', () => {
|
|
for (const workflowPath of [
|
|
'.github/workflows/build-desktop-dev.yml',
|
|
'.github/workflows/release-desktop.yml',
|
|
]) {
|
|
const workflow = readFileSync(workflowPath, 'utf8')
|
|
for (const stepName of ['Build sidecars', 'Build Tauri app']) {
|
|
const step = workflow.match(
|
|
new RegExp(`- name: ${stepName}[\\s\\S]*?(?:\\n\\s{6}- name:|\\n\\s*# ──|\\n\\s*with:|$)`),
|
|
)?.[0]
|
|
|
|
expect(step, `${workflowPath} ${stepName}`).toContain(
|
|
'BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-install-cache',
|
|
)
|
|
expect(step, `${workflowPath} ${stepName}`).toContain(
|
|
'TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}',
|
|
)
|
|
}
|
|
}
|
|
})
|
|
})
|