OXYGENHUB
# 2b668d92b066 oxygen / .flow / pipeline.kdl
1.7 KiB · last changed OxygenFlow pipeline: fmt, then clippy -D warnings, tests and a release build in microVMs on Earth, on every push 1 month ago source blame history raw
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/3ba0779a55b1d66fce10adf5a01585624c9aab089f590d228368c38fd3e65a46"
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
}
17
18
sandbox "rust-small" {
19
    runtime "microvm"
20
    rootfs "cas://blob/3ba0779a55b1d66fce10adf5a01585624c9aab089f590d228368c38fd3e65a46"
21
    memory-limit "1GiB"
22
    cpu-limit 1
23
    network "isolated"
24
}
25
26
job "fmt" {
27
    sandbox "rust-small"
28
    exec "cargo" "fmt" "--all" "--check"
29
}
30
31
job "clippy" {
32
    sandbox "rust"
33
    depends-on "fmt"
34
    mount {
35
        source "ephemeral://disk"
36
        target "/src/target"
37
        size "24GiB"
38
    }
39
    env {
40
        CARGO_INCREMENTAL "0"
41
    }
42
    exec "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
43
}
44
45
job "test" {
46
    sandbox "rust"
47
    depends-on "fmt"
48
    mount {
49
        source "ephemeral://disk"
50
        target "/src/target"
51
        size "24GiB"
52
    }
53
    env {
54
        CARGO_INCREMENTAL "0"
55
    }
56
    exec "cargo" "test" "--workspace" "--locked"
57
}
58
59
job "build" {
60
    sandbox "rust"
61
    depends-on "fmt"
62
    mount {
63
        source "ephemeral://disk"
64
        target "/src/target"
65
        size "24GiB"
66
    }
67
    env {
68
        CARGO_INCREMENTAL "0"
69
    }
70
    exec "cargo" "build" "--release" "--locked"
71
}