Skip to content

test

test #32

Workflow file for this run

name: test
# Run the host-side Rust unit tests (decode + Vm layout) on every default-branch
# push and publish the results to the userland.run status hub.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # nightly: run the heavy node-harness suite
permissions:
contents: read
jobs:
cargo-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Run cargo unit tests (host)
run: cargo nextest run --profile ci
- name: Convert to results contract
run: node tools/junit-to-results.mjs target/nextest/ci/junit.xml --source nano --suite cargo-unit --map test/feature-map.json > userland-results.json
- name: Publish to status hub
if: github.ref == 'refs/heads/main'
uses: userland-run/status/.github/actions/publish-results@main
with:
source: nano
suite: cargo-unit
results-file: userland-results.json
token: ${{ secrets.STATUS_DISPATCH_TOKEN }}
# The behavioral half: MemFS + ELF execution + the 17 BusyBox applets, run
# through the Node harness. Builds just the busybox runtime (the full
# devenv bundle needs a slow Docker build, so devenv tool tests are skipped
# here). Heavy-ish (Git LFS + a wasm build), so nightly / on demand.
node-harness:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
# Force cargo onto the pinned toolchain: rust-toolchain.toml says "nightly"
# (latest), which would override dtolnay's pinned install otherwise.
env:
RUSTUP_TOOLCHAIN: nightly-2026-02-17
steps:
- uses: actions/checkout@v4
with:
lfs: true
# Pin the nightly: the shared-memory wasm + host-import linking is
# toolchain-sensitive; a later nightly's wasm-ld rejects the env imports
# that --allow-undefined accepts on this one.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-02-17
targets: wasm32-unknown-unknown
components: rust-src
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Build busybox runtime
run: make build-busybox && cp wasm/nano.busybox.wasm wasm/nano.wasm
- name: Run node harness with results ledger (ELF + BusyBox; devenv skipped)
run: RESULTS_NDJSON=ledger.ndjson bash test/run_tests.sh || true
- name: Convert ledger to results contract
run: node tools/harness-ledger-to-results.mjs ledger.ndjson --source nano --suite node-harness --map test/harness-feature-map.json > userland-results.json
- name: Publish to status hub
if: github.ref == 'refs/heads/main'
uses: userland-run/status/.github/actions/publish-results@main
with:
source: nano
suite: node-harness
results-file: userland-results.json
token: ${{ secrets.STATUS_DISPATCH_TOKEN }}