// oxygenhub-vscode's pipeline (OxygenFlow, docs in the oxygenflow repository):
// typecheck, bundle, tests and packaging, offline in a Firecracker microVM on
// Earth for every push. The hub client tests need a hub binary and skip here.
schema-version 1

// The OxygenFlow build image (oxygenflow/images/rust), with an npm cache of
// this repository's package-lock.json. Rebuild and re-pin it when that changes.
sandbox "node" {
    runtime "microvm"
    rootfs "cas://blob/85c744e509d45118942a8ca77408d56894bf7833fa806d20d08511cc90bc5024"
    memory-limit "2GiB"
    cpu-limit 2
    network "loopback"
}

job "check" {
    sandbox "node"
    exec "sh" "-euc" "npm ci --offline --cache /opt/npm-cache --no-audit --no-fund && npm run check"
}

job "package" {
    sandbox "node"
    depends-on "check"
    exec "sh" "-euc" "npm ci --offline --cache /opt/npm-cache --no-audit --no-fund && npm run package"
}
