OXYGENHUB
# 0d663e91c598 oxygenflow / .flow / pipeline.kdl
4.5 KiB · last changed The cheap checks run as WASM: layout, todos, size and summary are one WASI module (crates/flow-checks, .flow/checks.wasm), so any runner with the WASM tier takes them; the fmt job checks the module is what its source builds; the build image gains wasm32-wasip1 (re-pinned e52c41a1) (closes #96) 9 days ago source blame history raw
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
// The cheap checks as one WASI module (#96): crates/flow-checks, built by
15
// scripts/checks-wasm.sh and committed as .flow/checks.wasm (the fmt job
16
// fails if it is not what the source builds). No image and no KVM, so any
17
// runner with the WASM tier takes them: the phone, plex, windows-1.
18
sandbox "wasm" {
19
    runtime "wasm"
20
    memory-limit "64MiB"
21
}
22
23
job "layout" {
24
    sandbox "wasm"
25
    exec ".flow/checks.wasm" "layout" "Cargo.toml" "docs/m0.md" "crates/flow-core/src/pipeline.rs" "crates/flow-init/src/main.rs" "crates/flow/src/microvm.rs"
26
}
27
28
job "todos" {
29
    sandbox "wasm"
30
    scope "crates/**" ".flow/checks.wasm"
31
    exec ".flow/checks.wasm" "todos" "crates"
32
}
33
34
job "size" {
35
    sandbox "wasm"
36
    scope "crates/**" ".flow/checks.wasm"
37
    exec ".flow/checks.wasm" "size" "crates"
38
}
39
40
job "isolation" {
41
    sandbox "alpine"
42
    exec "sh" "-eu" ".flow/jobs/isolation.sh"
43
}
44
45
// The build image (images/rust): Rust with rustfmt and clippy, Node, and the
46
// vendored crates. oxygen comes from the pinned subrepo in deps/.
47
sandbox "rust" {
48
    runtime "microvm"
49
    rootfs "cas://blob/e52c41a173956b6bacc270eb81208a1b118b652412b84d15fa24708e6f8ec392"
50
    memory-limit "8GiB"
51
    cpu-limit 4
52
    network "loopback"
53
}
54
55
sandbox "rust-small" {
56
    runtime "microvm"
57
    rootfs "cas://blob/e52c41a173956b6bacc270eb81208a1b118b652412b84d15fa24708e6f8ec392"
58
    memory-limit "1GiB"
59
    cpu-limit 1
60
    network "isolated"
61
}
62
63
job "fmt" {
64
    sandbox "rust-small"
65
    // This workspace only (--all would reach the pinned oxygen in deps/),
66
    // and the checks' committed WASI module is what its source builds (#96).
67
    exec "sh" "-euc" "cargo fmt --check -p flow -p flow-core -p flow-init -p flow-casfs -p flow-checks && sh scripts/checks-wasm.sh --check"
68
}
69
70
job "clippy" {
71
    sandbox "rust"
72
    depends-on "fmt"
73
    mount {
74
        source "ephemeral://disk"
75
        target "/src/target"
76
        size "16GiB"
77
    }
78
    env {
79
        CARGO_INCREMENTAL "0"
80
    }
81
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
82
}
83
84
job "test" {
85
    sandbox "rust"
86
    depends-on "fmt"
87
    mount {
88
        source "ephemeral://disk"
89
        target "/src/target"
90
        size "16GiB"
91
    }
92
    env {
93
        CARGO_INCREMENTAL "0"
94
    }
95
    // The tests under cargo-nextest and cargo-llvm-cov (#82): a test report
96
    // (JUnit, kept whether or not they pass) and line coverage (LCOV) from
97
    // one run, for the hub's Tests and Coverage tabs.
98
    exec "sh" ".flow/warm-target.sh" "cargo" "llvm-cov" "nextest" "--workspace" "--locked" "--profile" "ci" "--lcov" "--output-path" "/src/target/lcov.info"
99
    output {
100
        artifact "junit" {
101
            path "/src/target/nextest/ci/junit.xml"
102
            when "always"
103
        }
104
        artifact "coverage" {
105
            path "/src/target/lcov.info"
106
        }
107
    }
108
}
109
110
// Runner builds for releases (oxygenhub#322): flow-linux-ARCH for x86_64,
111
// aarch64 and riscv64, which runners that update themselves are offered.
112
job "dist" {
113
    sandbox "rust"
114
    depends-on "fmt"
115
    scope "Cargo.toml" "scripts/dist.sh"
116
    mount {
117
        source "ephemeral://disk"
118
        target "/src/target"
119
        size "24GiB"
120
        cache "target"
121
        key "Cargo.lock"
122
    }
123
    env {
124
        DIST_FLAT "/src/target/dist-flat"
125
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
126
    }
127
    exec "bash" "scripts/dist.sh"
128
    output {
129
        artifact "flow-linux-x86_64" {
130
            path "/src/target/dist-flat/flow-linux-x86_64"
131
        }
132
        artifact "flow-linux-aarch64" {
133
            path "/src/target/dist-flat/flow-linux-aarch64"
134
        }
135
        artifact "flow-linux-riscv64" {
136
            path "/src/target/dist-flat/flow-linux-riscv64"
137
        }
138
        artifact "flow-windows-x86_64.exe" {
139
            path "/src/target/dist-flat/flow-windows-x86_64.exe"
140
        }
141
        artifact "SHA256SUMS" {
142
            path "/src/target/dist-flat/SHA256SUMS"
143
        }
144
    }
145
}
146
147
job "summary" {
148
    sandbox "wasm"
149
    depends-on "layout" "todos" "size" "isolation" "clippy" "test"
150
    env {
151
        PROJECT "OxygenFlow"
152
    }
153
    exec ".flow/checks.wasm" "summary"
154
}