mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
None of these change what CI checks — they remove work the runners repeated on every PR. - install-node-dependencies installed with --no-frozen-lockfile, so every job re-resolved the graph against the registry to recompute what the lockfile already pins. Measured at ~62 MB of packument metadata per job; the pnpm store cache does not cover the metadata cache, so this was paid ~39 times per run. The `git diff` guard that made the re-resolution redundant stays. - --ignore-scripts leaves node-pty with no build/Release, so ensure-native-runtime node-gyp-compiled it in every job asking for a runtime. Cache the build under an ABI-bound key (runtime, resolved Node version, node-pty patch) with no restore-keys, since a partial match is exactly the mismatched build that would be recompiled anyway. - The four fetch-depth: 0 checkouts pulled full history including every historical blob (blobs are ~89% of this repo's pack). They only need the commit graph for a merge-base diff, so fetch them blobless. Measured 30-43s each today versus 8s for the shallow checkouts. One of them, e2e-paths, gates the entire E2E chain. - E2E jobs ordered setup-node before pnpm, which meant setup-node could not find the store and no E2E job cached dependencies at all. Reorder and cache; this sits on the critical path in both the build job and each shard. - git_compatibility rebuilt Git 2.25.5 from a pinned tarball on every PR. Cache the build; the sha256 assertion still guards the miss path. - typecheck ran three independent tsc passes back to back and discarded the .tsbuildinfo each project already emits. Run them concurrently and cache the incremental state. - package (windows) built the electron-vite targets serially via build:release. Use a :parallel variant that overlaps them, matching what the Linux package job already packages and smoke-tests from. Contract tests cover each new cache's ordering and key so none of them can silently start serving a stale or ABI-mismatched artifact.
32 lines
1.5 KiB
JavaScript
32 lines
1.5 KiB
JavaScript
import { readFileSync } from 'node:fs'
|
|
import { parse } from 'yaml'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8'))
|
|
|
|
describe('packaged skills CLI PR gates', () => {
|
|
it('builds and executes the Windows packaged CLI', () => {
|
|
const job = workflow.jobs.package_windows
|
|
const buildStep = job.steps.find((step) => step.name === 'Build package inputs')
|
|
const prepareStep = job.steps.find((step) => step.name === 'Prepare Electron native runtime')
|
|
const packageStep = job.steps.find((step) => step.name === 'Package unpacked app')
|
|
const smokeStep = job.steps.find((step) => step.name === 'Smoke packaged CLI')
|
|
|
|
expect(job['runs-on']).toBe('windows-2022')
|
|
expect(buildStep.run).toBe('pnpm run build:release:parallel')
|
|
expect(prepareStep.run).toBe('node config/scripts/ensure-native-runtime.mjs --runtime=electron')
|
|
expect(packageStep.run).toContain('electron-builder')
|
|
expect(packageStep.run).toContain('--dir')
|
|
expect(packageStep.env.ORCA_REUSE_PREPARED_NATIVE_RUNTIME).toBe('1')
|
|
expect(smokeStep.run).toBe(
|
|
'node config/scripts/smoke-packaged-cli.mjs --app-dir=dist/win-unpacked'
|
|
)
|
|
|
|
const aggregateStep = workflow.jobs.verify.steps.find(
|
|
(step) => step.name === 'Require successful checks'
|
|
)
|
|
expect(aggregateStep.env.PACKAGE_WINDOWS).toBe('${{ needs.package_windows.result }}')
|
|
expect(aggregateStep.run).toContain('"$PACKAGE_WINDOWS"')
|
|
})
|
|
})
|