| 1 |
// OxygenFlow's own pipeline (docs/m0.md). Runs in Firecracker microVMs on |
| 2 |
// Earth for every push to a bookmark; see the Flow tab on OxygenHub. |
| 3 |
schema-version 1 |
| 4 |
|
| 5 |
sandbox "alpine" { |
| 6 |
runtime "microvm" |
| 7 |
// Alpine 3.24.2 minirootfs, imported on Earth with `flow rootfs import`. |
| 8 |
rootfs "cas://blob/e95d22fb2380b67193f2640a12c2f8c7bae485f6fd14330bdb0c7157faa588dc" |
| 9 |
memory-limit "256MiB" |
| 10 |
cpu-limit 1 |
| 11 |
network "isolated" |
| 12 |
} |
| 13 |
|
| 14 |
job "layout" { |
| 15 |
sandbox "alpine" |
| 16 |
exec "sh" "-eu" ".flow/jobs/layout.sh" |
| 17 |
} |
| 18 |
|
| 19 |
job "todos" { |
| 20 |
sandbox "alpine" |
| 21 |
scope "crates/**" |
| 22 |
exec "sh" "-eu" ".flow/jobs/todos.sh" |
| 23 |
} |
| 24 |
|
| 25 |
job "size" { |
| 26 |
sandbox "alpine" |
| 27 |
scope "crates/**" |
| 28 |
exec "sh" "-eu" ".flow/jobs/size.sh" |
| 29 |
} |
| 30 |
|
| 31 |
job "isolation" { |
| 32 |
sandbox "alpine" |
| 33 |
exec "sh" "-eu" ".flow/jobs/isolation.sh" |
| 34 |
} |
| 35 |
|
| 36 |
// The build image (images/rust): Rust with rustfmt and clippy, Node, and the |
| 37 |
// vendored crates. oxygen comes from the pinned subrepo in deps/. |
| 38 |
sandbox "rust" { |
| 39 |
runtime "microvm" |
| 40 |
rootfs "cas://blob/3fa57d4c1dc8aa5d4d92665bc13f332357f55042f658543dc21b1540b3aced69" |
| 41 |
memory-limit "8GiB" |
| 42 |
cpu-limit 4 |
| 43 |
network "loopback" |
| 44 |
// CI builds are thrown away: no incremental state and no debug info, |
| 45 |
// so less to compile, link and write (as in oxygenhub's pipeline). |
| 46 |
env { |
| 47 |
CARGO_INCREMENTAL "0" |
| 48 |
CARGO_PROFILE_DEV_DEBUG "0" |
| 49 |
CARGO_PROFILE_TEST_DEBUG "0" |
| 50 |
CARGO_PROFILE_RELEASE_DEBUG "0" |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
sandbox "rust-small" { |
| 55 |
runtime "microvm" |
| 56 |
rootfs "cas://blob/3fa57d4c1dc8aa5d4d92665bc13f332357f55042f658543dc21b1540b3aced69" |
| 57 |
memory-limit "1GiB" |
| 58 |
cpu-limit 1 |
| 59 |
network "isolated" |
| 60 |
} |
| 61 |
|
| 62 |
job "fmt" { |
| 63 |
sandbox "rust-small" |
| 64 |
// This workspace only: --all would reach the pinned oxygen in deps/. |
| 65 |
exec "cargo" "fmt" "--check" "-p" "flow" "-p" "flow-core" "-p" "flow-init" "-p" "flow-casfs" |
| 66 |
} |
| 67 |
|
| 68 |
job "clippy" { |
| 69 |
sandbox "rust" |
| 70 |
depends-on "fmt" |
| 71 |
mount { |
| 72 |
source "ephemeral://disk" |
| 73 |
target "/src/target" |
| 74 |
size "16GiB" |
| 75 |
// Kept from this job's last passing run (oxygenflow#28): cargo |
| 76 |
// builds only what changed since. |
| 77 |
cache "target" |
| 78 |
key "Cargo.lock" |
| 79 |
} |
| 80 |
// One build identity for every CI state, so the cached target stays |
| 81 |
// fresh from one push to the next (oxygenflow#52). |
| 82 |
env { |
| 83 |
OXY_BUILD "ci" |
| 84 |
} |
| 85 |
exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings" |
| 86 |
} |
| 87 |
|
| 88 |
job "test" { |
| 89 |
sandbox "rust" |
| 90 |
depends-on "fmt" |
| 91 |
mount { |
| 92 |
source "ephemeral://disk" |
| 93 |
target "/src/target" |
| 94 |
size "16GiB" |
| 95 |
// Kept from this job's last passing run (oxygenflow#28): cargo |
| 96 |
// builds only what changed since. |
| 97 |
cache "target" |
| 98 |
key "Cargo.lock" |
| 99 |
} |
| 100 |
// One build identity for every CI state, so the cached target stays |
| 101 |
// fresh from one push to the next (oxygenflow#52). |
| 102 |
env { |
| 103 |
OXY_BUILD "ci" |
| 104 |
} |
| 105 |
exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked" |
| 106 |
} |
| 107 |
|
| 108 |
job "summary" { |
| 109 |
sandbox "alpine" |
| 110 |
depends-on "layout" "todos" "size" "isolation" "clippy" "test" |
| 111 |
env { |
| 112 |
PROJECT "OxygenFlow" |
| 113 |
} |
| 114 |
exec "sh" "-eu" ".flow/jobs/summary.sh" |
| 115 |
} |