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