| 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/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b" |
| 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/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b" |
| 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 |
// The tests under cargo-nextest and cargo-llvm-cov (#82): a test report |
| 106 |
// (JUnit, kept whether or not they pass) and line coverage (LCOV) from |
| 107 |
// one run, for the hub's Tests and Coverage tabs. |
| 108 |
exec "sh" ".flow/warm-target.sh" "cargo" "llvm-cov" "nextest" "--workspace" "--locked" "--profile" "ci" "--lcov" "--output-path" "/src/target/lcov.info" |
| 109 |
output { |
| 110 |
artifact "junit" { |
| 111 |
path "/src/target/nextest/ci/junit.xml" |
| 112 |
when "always" |
| 113 |
} |
| 114 |
artifact "coverage" { |
| 115 |
path "/src/target/lcov.info" |
| 116 |
} |
| 117 |
} |
| 118 |
} |
| 119 |
|
| 120 |
// Runner builds for releases (oxygenhub#322): flow-linux-ARCH for x86_64, |
| 121 |
// aarch64 and riscv64, which runners that update themselves are offered. |
| 122 |
job "dist" { |
| 123 |
sandbox "rust" |
| 124 |
depends-on "fmt" |
| 125 |
scope "Cargo.toml" "scripts/dist.sh" |
| 126 |
mount { |
| 127 |
source "ephemeral://disk" |
| 128 |
target "/src/target" |
| 129 |
size "24GiB" |
| 130 |
cache "target" |
| 131 |
key "Cargo.lock" |
| 132 |
} |
| 133 |
env { |
| 134 |
DIST_FLAT "/src/target/dist-flat" |
| 135 |
ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache" |
| 136 |
} |
| 137 |
exec "bash" "scripts/dist.sh" |
| 138 |
output { |
| 139 |
artifact "flow-linux-x86_64" { |
| 140 |
path "/src/target/dist-flat/flow-linux-x86_64" |
| 141 |
} |
| 142 |
artifact "flow-linux-aarch64" { |
| 143 |
path "/src/target/dist-flat/flow-linux-aarch64" |
| 144 |
} |
| 145 |
artifact "flow-linux-riscv64" { |
| 146 |
path "/src/target/dist-flat/flow-linux-riscv64" |
| 147 |
} |
| 148 |
artifact "flow-windows-x86_64.exe" { |
| 149 |
path "/src/target/dist-flat/flow-windows-x86_64.exe" |
| 150 |
} |
| 151 |
artifact "SHA256SUMS" { |
| 152 |
path "/src/target/dist-flat/SHA256SUMS" |
| 153 |
} |
| 154 |
} |
| 155 |
} |
| 156 |
|
| 157 |
job "summary" { |
| 158 |
sandbox "alpine" |
| 159 |
depends-on "layout" "todos" "size" "isolation" "clippy" "test" |
| 160 |
env { |
| 161 |
PROJECT "OxygenFlow" |
| 162 |
} |
| 163 |
exec "sh" "-eu" ".flow/jobs/summary.sh" |
| 164 |
} |