The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (c) 2026 BoxLite AI
import assert from 'node:assert/strict'
import { execFileSync, spawnSync } from 'node:child_process'
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import test from 'node:test'
import { load } from 'js-yaml'
const workflow = name => load(readFileSync(new URL('../../../.github/workflows/' + name + '.yml', import.meta.url), 'utf8'))
test('dev build calls select only Linux x64 and publication waits for their complements', () => {
const { jobs } = workflow('mbuild-release')
for (const component of ['runtime', 'wheels', 'node', 'c']) {
const id = 'build-' + component
assert.match(jobs[id].with.spec_platform ?? '', /linux-x64/, id + ' blocks dev on every platform')
assert.ok(jobs.dev.needs.includes(id))
assert.equal(jobs[id + '-other'].with.spec_platform, 'except-linux-x64')
assert.ok(!jobs.dev.needs.includes(id + '-other'))
}
})
test('the shared platform filter partitions the repository matrix and rejects unknown values', t => {
const directory = mkdtempSync(join(tmpdir(), 'release-platforms-'))
t.after(() => rmSync(directory, { recursive: true, force: true }))
const action = new URL('../../../.github/actions/ci-config/', import.meta.url)
const config = load(readFileSync(new URL('action.yml', action))).runs.steps[0]
function select(scope) {
const output = join(directory, scope || 'default')
const env = { ...process.env, GITHUB_ACTION_PATH: fileURLToPath(action), GITHUB_OUTPUT: output, FULL_MATRIX: 'true', SPEC_PLATFORM: scope }
execFileSync('bash', ['-ec', config.run], { env })
const row = readFileSync(output, 'utf8').split('\n').find(line => line.startsWith('platforms='))
return JSON.parse(row.slice('platforms='.length)).map(platform => platform.target)
}
const all = select('all')
assert.deepEqual(select(''), all)
assert.deepEqual(select('linux-x64'), ['linux-x64-gnu'])
assert.deepEqual(select('except-linux-x64'), all.filter(target => target !== 'linux-x64-gnu'))
const unknown = spawnSync('bash', ['-ec', config.run], { env: { ...process.env, FULL_MATRIX: 'true', SPEC_PLATFORM: 'macish' } })
assert.notEqual(unknown.status, 0)
})