OXYGENHUB

CI on OxygenFlow: fmt, clippy, test and build on every push (#2) ad258dc8cf5e

Author
Andy McCall @andymccall <[email protected]>
via
agent agent:claude@andymccall <[email protected]> · keyless, under your grant for changes,refs,seal · key 3de73336a0e3
When
· 2026-11-02 21:39 UTC
Signature
◈ sealed by agent:claude@andymccall
Hash
ad258dc8cf5ea8c167e536b36c238fedb569752666a7c6dd845d1348aaddc369
Depends on
258bb3824813
Depended on by
862f0db224aa 36537112fcac
In bookmarks
main
In tags
v0.1.0
Receipts
✔ fmt passed in 2.6 s · signed by earth-1 job 14315 · download
✔ clippy passed in 48.9 s · signed by plex-1 job 14317 · download
✔ build passed in 2 min 38 s · signed by earth-1 job 14316 · download
✔ test passed in 1 min 45 s · signed by plex-1 job 14318 · download
Edits
3 atoms, 4 tree operations, 3 files

Browse the tree at this change

added .config/nextest.toml +8 −0
1 +
# The CI profile (oxygen#139): every test runs, and a JUnit report is
2 +
# written to target/nextest/ci/junit.xml for the hub's test report
3 +
# (the job's `junit` artifact).
4 +
[profile.ci]
5 +
fail-fast = false
6 +
7 +
[profile.ci.junit]
8 +
path = "junit.xml"
added .flow/pipeline.kdl +109 −0
1 +
// Spectra's own pipeline (OxygenFlow, docs in the oxygenflow repository), in
2 +
// the shape of Oxygen's. Every push to a bookmark on OxygenHub runs it in
3 +
// Firecracker microVMs on Earth; the jobs appear as checks on the change.
4 +
schema-version 1
5 +
6 +
// The OxygenFlow build image: Rust with rustfmt and clippy, nextest and
7 +
// llvm-cov, and the crates of oxygen, oxygenhub and oxygenflow vendored
8 +
// (oxygenflow/images/rust). Spectra keeps to those crates
9 +
// (`make deps-check`), so the same image builds it with no network.
10 +
sandbox "rust" {
11 +
    runtime "microvm"
12 +
    rootfs "cas://blob/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b"
13 +
    memory-limit "8GiB"
14 +
    cpu-limit 4
15 +
    // Tests serve and connect on 127.0.0.1 and a Unix socket; nothing
16 +
    // leaves the guest.
17 +
    network "loopback"
18 +
    // CI builds are thrown away: no incremental state and no debug info,
19 +
    // so less to compile, link and write (as in oxygen's pipeline).
20 +
    env {
21 +
        CARGO_INCREMENTAL "0"
22 +
        CARGO_PROFILE_DEV_DEBUG "0"
23 +
        CARGO_PROFILE_TEST_DEBUG "0"
24 +
        CARGO_PROFILE_RELEASE_DEBUG "0"
25 +
    }
26 +
}
27 +
28 +
sandbox "rust-small" {
29 +
    runtime "microvm"
30 +
    rootfs "cas://blob/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b"
31 +
    memory-limit "1GiB"
32 +
    cpu-limit 1
33 +
    network "isolated"
34 +
}
35 +
36 +
// Spectra's own packages only: `--all` would reach the pinned Oxygen in
37 +
// deps/, which has its own formatting (as in oxygenhub).
38 +
job "fmt" {
39 +
    sandbox "rust-small"
40 +
    exec "cargo" "fmt" "-p" "spectra" "-p" "spectra-core" "-p" "spectra-mcp" "-p" "spectra-api" "-p" "radar" "--check"
41 +
}
42 +
43 +
job "clippy" {
44 +
    sandbox "rust"
45 +
    depends-on "fmt"
46 +
    mount {
47 +
        source "ephemeral://disk"
48 +
        target "/src/target"
49 +
        size "16GiB"
50 +
        // Kept from this job's last passing run (oxygenflow#28): cargo
51 +
        // builds only what changed since.
52 +
        cache "target"
53 +
        key "Cargo.lock"
54 +
    }
55 +
    // One build identity for every CI state, so the cached target stays
56 +
    // fresh from one push to the next (oxygenflow#52).
57 +
    env {
58 +
        SPECTRA_BUILD "ci"
59 +
    }
60 +
    exec "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
61 +
}
62 +
63 +
// The tests, run under cargo-nextest and cargo-llvm-cov: a test report
64 +
// (JUnit, kept whether or not they pass) for the hub's Tests tab and line
65 +
// coverage (LCOV) for its Coverage tab, from one run.
66 +
job "test" {
67 +
    sandbox "rust"
68 +
    depends-on "fmt"
69 +
    mount {
70 +
        source "ephemeral://disk"
71 +
        target "/src/target"
72 +
        size "16GiB"
73 +
        cache "target"
74 +
        key "Cargo.lock"
75 +
    }
76 +
    env {
77 +
        SPECTRA_BUILD "ci"
78 +
    }
79 +
    exec "cargo" "llvm-cov" "nextest" "--workspace" "--locked" "--profile" "ci" "--lcov" "--output-path" "/src/target/lcov.info"
80 +
    output {
81 +
        artifact "junit" {
82 +
            path "/src/target/nextest/ci/junit.xml"
83 +
            when "always"
84 +
        }
85 +
        artifact "coverage" {
86 +
            path "/src/target/lcov.info"
87 +
        }
88 +
    }
89 +
}
90 +
91 +
job "build" {
92 +
    sandbox "rust"
93 +
    depends-on "fmt"
94 +
    mount {
95 +
        source "ephemeral://disk"
96 +
        target "/src/target"
97 +
        size "16GiB"
98 +
        cache "target"
99 +
        key "Cargo.lock"
100 +
    }
101 +
    exec "cargo" "build" "--release" "--locked"
102 +
    // The binary, kept as a blob of this repository and named by the
103 +
    // job's signed receipt; the run page links it.
104 +
    output {
105 +
        artifact "spectra" {
106 +
            path "/src/target/release/spectra"
107 +
        }
108 +
    }
109 +
}
modified CHANGELOG.md +1 −0
…
1 unchanged lines
2 2
3 3
## Unreleased
4 4
5 +
- **Added: CI on OxygenFlow (#2).** `.flow/pipeline.kdl` in the shape of Oxygen's: fmt, clippy, test (nextest under llvm-cov, with JUnit and coverage for the hub) and build, in the vendored image with no network.
5 6
- **Added: the project skeleton (#1).** A Cargo workspace in Oxygen's shape (`spectra-core`, `spectra-mcp`, `spectra-api`, `radar` and the `spectra` binary), Oxygen pinned under `deps/oxygen` for identities and signatures, `make check`, the changelog check, `spectra version [--json]` with the build identity, and `scripts/deps-check.sh` to keep Spectra buildable by the vendored OxygenFlow image.