OXYGENHUB
# 232aabb5452d oxygen / .flow / pipeline.kdl
5.2 KiB · last changed Name moved subrepo pins in status and commit; changelog on the WASM tier (closes #162) 2 days ago source blame history raw
This file is in conflict in this state; the markers below are the conflict. All conflicts
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
// Cheap checks on the WASM tier (oxygenflow#96): OxygenFlow's checks module,
7
// copied from oxygenflow/.flow/checks.wasm (built there from
8
// crates/flow-checks; copy it again when it changes). No image and no KVM,
9
// so any runner with the WASM tier takes it: a phone, plex, windows-1.
10
sandbox "wasm" {
11
    runtime "wasm"
12
    memory-limit "64MiB"
13
}
14
15
// The changelog's shape, and a section for the version Cargo.toml says, so a
16
// release never finds its notes missing.
17
job "changelog" {
18
    sandbox "wasm"
19
    scope "CHANGELOG.md" "Cargo.toml" ".flow/checks.wasm"
20
    exec ".flow/checks.wasm" "changelog" "CHANGELOG.md" "Cargo.toml"
21
}
22
23
// The OxygenFlow build image: Rust with rustfmt and clippy, Node, and every
24
// crate of Cargo.lock vendored (oxygenflow/images/rust). Rebuild and re-pin
25
// it when Cargo.lock changes.
26
sandbox "rust" {
27
    runtime "microvm"
28
    rootfs "cas://blob/7705d699a4fc06862e4297b7069396cf3b5b35b1d3f15191c46dc2031af17133"
29
    memory-limit "8GiB"
30
    cpu-limit 4
31
    // Tests serve and connect on 127.0.0.1; nothing leaves the guest.
32
    network "loopback"
33
}
34
35
sandbox "rust-small" {
36
    runtime "microvm"
37
    rootfs "cas://blob/7705d699a4fc06862e4297b7069396cf3b5b35b1d3f15191c46dc2031af17133"
38
    memory-limit "1GiB"
39
    cpu-limit 1
40
    network "isolated"
41
}
42
43
job "fmt" {
44
    sandbox "rust-small"
45
    exec "cargo" "fmt" "--all" "--check"
46
}
47
48
job "clippy" {
49
    sandbox "rust"
50
    depends-on "fmt"
51
    mount {
52
        source "ephemeral://disk"
53
        target "/src/target"
54
        size "24GiB"
55
    }
56
<<<<<<< oxy conflict 1 of 1, side 1 of 2: change 110a6605 "OxygenFlow pipeline: fmt, then clippy -D warnings, tests and a release build in microVMs on Earth, on every push"
57
    env {
58
        CARGO_INCREMENTAL "0"
59
    }
60
======= oxy conflict 1 of 1, side 2 of 2: change 116da477 "CI starts from the build image's prebuilt dependencies"
61
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
62
>>>>>>> oxy conflict 1 of 1 end
63
}
64
65
// The tests, run under cargo-nextest and cargo-llvm-cov: a test report
66
// (JUnit, kept whether or not they pass; #139) for the hub's Tests tab and
67
// line coverage (LCOV, oxygenhub#113) for its Coverage tab, from one run.
68
job "test" {
69
    sandbox "rust"
70
    depends-on "fmt"
71
    mount {
72
        source "ephemeral://disk"
73
        target "/src/target"
74
        size "24GiB"
75
    }
76
    env {
77
        CARGO_INCREMENTAL "0"
78
    }
79
    exec "cargo" "llvm-cov" "nextest" "--workspace" "--locked" "--profile" "ci" "--lcov" "--output-path" "/src/target/lcov.info"
80
    output {
81
        artifact "junit" {
82
            path "/src/target/nextest/ci/junit.xml"
83
            when "always"
84
        }
85
        artifact "coverage" {
86
            path "/src/target/lcov.info"
87
        }
88
    }
89
}
90
91
job "build" {
92
    sandbox "rust"
93
    depends-on "fmt"
94
    mount {
95
        source "ephemeral://disk"
96
        target "/src/target"
97
        size "24GiB"
98
    }
99
    env {
100
        CARGO_INCREMENTAL "0"
101
    }
102
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
103
}
104
105
// Release files for every platform (oxygen#59): scripts/dist.sh in the
106
// build image's cross toolchains. A push runs it only when it touches
107
// these paths (a release moves Cargo.toml's version); "Run pipeline" and
108
// reruns always do. The files are kept as this run's artifacts, named by
109
// its signed receipt, and attached to the release from there, so the
110
// release's trust page shows each as built here.
111
job "dist" {
112
    sandbox "rust"
113
    depends-on "fmt"
114
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**"
115
    mount {
116
        source "ephemeral://disk"
117
        target "/src/target"
118
        size "24GiB"
119
    }
120
    env {
121
        DIST_FLAT "/src/target/dist-flat"
122
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
123
    }
124
    exec "bash" "scripts/dist.sh"
125
    output {
126
        artifact "oxy-linux-x86_64.tar.gz" {
127
            path "/src/target/dist-flat/oxy-linux-x86_64.tar.gz"
128
        }
129
        artifact "oxy-linux-arm64.tar.gz" {
130
            path "/src/target/dist-flat/oxy-linux-arm64.tar.gz"
131
        }
132
        artifact "oxy-linux-riscv64.tar.gz" {
133
            path "/src/target/dist-flat/oxy-linux-riscv64.tar.gz"
134
        }
135
        artifact "oxy-macos-x86_64.tar.gz" {
136
            path "/src/target/dist-flat/oxy-macos-x86_64.tar.gz"
137
        }
138
        artifact "oxy-macos-arm64.tar.gz" {
139
            path "/src/target/dist-flat/oxy-macos-arm64.tar.gz"
140
        }
141
        artifact "oxy-windows-x86_64.zip" {
142
            path "/src/target/dist-flat/oxy-windows-x86_64.zip"
143
        }
144
        artifact "oxy_amd64.deb" {
145
            path "/src/target/dist-flat/oxy_amd64.deb"
146
        }
147
        artifact "oxy_arm64.deb" {
148
            path "/src/target/dist-flat/oxy_arm64.deb"
149
        }
150
        artifact "oxy_riscv64.deb" {
151
            path "/src/target/dist-flat/oxy_riscv64.deb"
152
        }
153
        artifact "oxy-src.tar.gz" {
154
            path "/src/target/dist-flat/oxy-src.tar.gz"
155
        }
156
        artifact "SHA256SUMS" {
157
            path "/src/target/dist-flat/SHA256SUMS"
158
        }
159
    }
160
}