OXYGENHUB
# 045f967db8f2 oxygenhub / .flow / pipeline.kdl
2.2 KiB · last changed CI builds without debug info or incremental state 1 month ago source blame history raw
1
// OxygenHub's 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. oxygen and oxygenflow come
4
// from the pinned subrepos in deps/, which the runner puts in the workspace.
5
schema-version 1
6
7
// The OxygenFlow build image: Rust with rustfmt and clippy, Node, and every
8
// crate of Cargo.lock vendored (oxygenflow/images/rust). Rebuild and re-pin
9
// it when Cargo.lock changes.
10
sandbox "rust" {
11
    runtime "microvm"
12
    rootfs "cas://blob/3ba0779a55b1d66fce10adf5a01585624c9aab089f590d228368c38fd3e65a46"
13
    memory-limit "8GiB"
14
    cpu-limit 4
15
    // Tests serve and connect on 127.0.0.1; nothing leaves the guest.
16
    network "loopback"
17
    // CI builds are thrown away: no incremental state, and no debug info
18
    // (the release profile keeps line tables for the binary Earth runs,
19
    // which is built outside CI), so less to compile, link and write.
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/3ba0779a55b1d66fce10adf5a01585624c9aab089f590d228368c38fd3e65a46"
31
    memory-limit "1GiB"
32
    cpu-limit 1
33
    network "isolated"
34
}
35
36
job "fmt" {
37
    sandbox "rust-small"
38
    // Only this workspace's packages: --all would also check the path
39
    // dependencies in deps/, which follow their own formatting.
40
    exec "cargo" "fmt" "--check" "-p" "oxygenhub" "-p" "hub-api"
41
}
42
43
job "clippy" {
44
    sandbox "rust"
45
    depends-on "fmt"
46
    mount {
47
        source "ephemeral://disk"
48
        target "/src/target"
49
        size "24GiB"
50
    }
51
    exec "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
52
}
53
54
job "test" {
55
    sandbox "rust"
56
    depends-on "fmt"
57
    mount {
58
        source "ephemeral://disk"
59
        target "/src/target"
60
        size "24GiB"
61
    }
62
    exec "cargo" "test" "--workspace" "--locked"
63
}
64
65
job "build" {
66
    sandbox "rust"
67
    depends-on "fmt"
68
    mount {
69
        source "ephemeral://disk"
70
        target "/src/target"
71
        size "24GiB"
72
    }
73
    exec "cargo" "build" "--release" "--locked"
74
}