| 1 |
// Oxygen's own pipeline (OxygenFlow, docs in the oxygenflow repository). |
| 2 |
// Every push to a bookmark on OxygenHub runs it in Firecracker microVMs on |
| 3 |
// Earth; the jobs appear as checks on the change. |
| 4 |
schema-version 1 |
| 5 |
|
| 6 |
// The OxygenFlow build image: Rust with rustfmt and clippy, Node, and every |
| 7 |
// crate of Cargo.lock vendored (oxygenflow/images/rust). Rebuild and re-pin |
| 8 |
// it when Cargo.lock changes. |
| 9 |
sandbox "rust" { |
| 10 |
runtime "microvm" |
| 11 |
rootfs "cas://blob/a3b49f36a2ad1838219ea0b7985591e44ac0e6d7f92e9d993d3a3738263fe32e" |
| 12 |
memory-limit "8GiB" |
| 13 |
cpu-limit 4 |
| 14 |
// Tests serve and connect on 127.0.0.1; nothing leaves the guest. |
| 15 |
network "loopback" |
| 16 |
// CI builds are thrown away: no incremental state and no debug info, |
| 17 |
// so less to compile, link and write (as in oxygenhub's pipeline). |
| 18 |
env { |
| 19 |
CARGO_INCREMENTAL "0" |
| 20 |
CARGO_PROFILE_DEV_DEBUG "0" |
| 21 |
CARGO_PROFILE_TEST_DEBUG "0" |
| 22 |
CARGO_PROFILE_RELEASE_DEBUG "0" |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
sandbox "rust-small" { |
| 27 |
runtime "microvm" |
| 28 |
rootfs "cas://blob/a3b49f36a2ad1838219ea0b7985591e44ac0e6d7f92e9d993d3a3738263fe32e" |
| 29 |
memory-limit "1GiB" |
| 30 |
cpu-limit 1 |
| 31 |
network "isolated" |
| 32 |
} |
| 33 |
|
| 34 |
job "fmt" { |
| 35 |
sandbox "rust-small" |
| 36 |
exec "cargo" "fmt" "--all" "--check" |
| 37 |
} |
| 38 |
|
| 39 |
job "clippy" { |
| 40 |
sandbox "rust" |
| 41 |
depends-on "fmt" |
| 42 |
mount { |
| 43 |
source "ephemeral://disk" |
| 44 |
target "/src/target" |
| 45 |
size "24GiB" |
| 46 |
} |
| 47 |
exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings" |
| 48 |
} |
| 49 |
|
| 50 |
job "test" { |
| 51 |
sandbox "rust" |
| 52 |
depends-on "fmt" |
| 53 |
mount { |
| 54 |
source "ephemeral://disk" |
| 55 |
target "/src/target" |
| 56 |
size "24GiB" |
| 57 |
} |
| 58 |
exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked" |
| 59 |
} |
| 60 |
|
| 61 |
job "build" { |
| 62 |
sandbox "rust" |
| 63 |
depends-on "fmt" |
| 64 |
mount { |
| 65 |
source "ephemeral://disk" |
| 66 |
target "/src/target" |
| 67 |
size "24GiB" |
| 68 |
} |
| 69 |
exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked" |
| 70 |
// The binary, kept as a blob of this repository and named by the |
| 71 |
// job's signed receipt; the run page links it. |
| 72 |
output { |
| 73 |
artifact "oxy" { |
| 74 |
path "/src/target/release/oxy" |
| 75 |
} |
| 76 |
} |
| 77 |
} |