OXYGENHUB
# 412808f9f769 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) 10 days ago source blame history raw
f29b88af Andy McCall 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
5544c899 Andy McCall ↶ 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
f29b88af Andy McCall 23
job "layout" {
5544c899 Andy McCall ↶ 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"
f29b88af Andy McCall 26
}
27
28
job "todos" {
5544c899 Andy McCall ↶ 29
    sandbox "wasm"
30
    scope "crates/**" ".flow/checks.wasm"
31
    exec ".flow/checks.wasm" "todos" "crates"
f29b88af Andy McCall 32
}
33
34
job "size" {
5544c899 Andy McCall ↶ 35
    sandbox "wasm"
36
    scope "crates/**" ".flow/checks.wasm"
37
    exec ".flow/checks.wasm" "size" "crates"
f29b88af Andy McCall 38
}
39
40
job "isolation" {
41
    sandbox "alpine"
42
    exec "sh" "-eu" ".flow/jobs/isolation.sh"
43
}
44
fe128fa6 Andy McCall ↶ 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"
5544c899 Andy McCall ↶ 49
    rootfs "cas://blob/e52c41a173956b6bacc270eb81208a1b118b652412b84d15fa24708e6f8ec392"
fe128fa6 Andy McCall ↶ 50
    memory-limit "8GiB"
51
    cpu-limit 4
52
    network "loopback"
53
}
54
55
sandbox "rust-small" {
56
    runtime "microvm"
5544c899 Andy McCall ↶ 57
    rootfs "cas://blob/e52c41a173956b6bacc270eb81208a1b118b652412b84d15fa24708e6f8ec392"
fe128fa6 Andy McCall ↶ 58
    memory-limit "1GiB"
59
    cpu-limit 1
60
    network "isolated"
61
}
62
63
job "fmt" {
64
    sandbox "rust-small"
5544c899 Andy McCall ↶ 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"
fe128fa6 Andy McCall ↶ 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
    }
2b40cb9b Andy McCall ↶ 81
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
fe128fa6 Andy McCall ↶ 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
    }
9e5fd161 Andy McCall ↶ 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
    }
fe128fa6 Andy McCall ↶ 108
}
109
72772aa0 Andy McCall ↶ 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
        }
6f66e397 Andy McCall ↶ 138
        artifact "flow-windows-x86_64.exe" {
139
            path "/src/target/dist-flat/flow-windows-x86_64.exe"
140
        }
72772aa0 Andy McCall ↶ 141
        artifact "SHA256SUMS" {
142
            path "/src/target/dist-flat/SHA256SUMS"
143
        }
144
    }
145
}
146
f29b88af Andy McCall 147
job "summary" {
5544c899 Andy McCall ↶ 148
    sandbox "wasm"
fe128fa6 Andy McCall ↶ 149
    depends-on "layout" "todos" "size" "isolation" "clippy" "test"
f29b88af Andy McCall 150
    env {
151
        PROJECT "OxygenFlow"
152
    }
5544c899 Andy McCall ↶ 153
    exec ".flow/checks.wasm" "summary"
f29b88af Andy McCall 154
}