OXYGENHUB
# 2b668d92b066 +2 oxygen / .flow / pipeline.kdl
4.0 KiB · last changed Pin the build image with the patched crates vendored (refs #63) 1 month 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
// The OxygenFlow build image: Rust with rustfmt and clippy, Node, and every
7
// crate of Cargo.lock vendored (oxygenflow/images/rust). Rebuild and re-pin
8
// it when Cargo.lock changes.
9
sandbox "rust" {
10
    runtime "microvm"
11
    rootfs "cas://blob/affd50628428966adc46670047468d4471cd589b4b92ef889981b2587a4eeed1"
12
    memory-limit "8GiB"
13
    cpu-limit 4
14
    // Tests serve and connect on 127.0.0.1; nothing leaves the guest.
15
    network "loopback"
16
}
17
18
sandbox "rust-small" {
19
    runtime "microvm"
20
    rootfs "cas://blob/affd50628428966adc46670047468d4471cd589b4b92ef889981b2587a4eeed1"
21
    memory-limit "1GiB"
22
    cpu-limit 1
23
    network "isolated"
24
}
25
26
job "fmt" {
27
    sandbox "rust-small"
28
    exec "cargo" "fmt" "--all" "--check"
29
}
30
31
job "clippy" {
32
    sandbox "rust"
33
    depends-on "fmt"
34
    mount {
35
        source "ephemeral://disk"
36
        target "/src/target"
37
        size "24GiB"
38
    }
39
<<<<<<< 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"
40
    env {
41
        CARGO_INCREMENTAL "0"
42
    }
43
======= oxy conflict 1 of 1, side 2 of 2: change 116da477 "CI starts from the build image's prebuilt dependencies"
44
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
45
>>>>>>> oxy conflict 1 of 1 end
46
}
47
48
job "test" {
49
    sandbox "rust"
50
    depends-on "fmt"
51
    mount {
52
        source "ephemeral://disk"
53
        target "/src/target"
54
        size "24GiB"
55
    }
56
    env {
57
        CARGO_INCREMENTAL "0"
58
    }
59
    exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked"
60
}
61
62
job "build" {
63
    sandbox "rust"
64
    depends-on "fmt"
65
    mount {
66
        source "ephemeral://disk"
67
        target "/src/target"
68
        size "24GiB"
69
    }
70
    env {
71
        CARGO_INCREMENTAL "0"
72
    }
73
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
74
}
75
76
// Release files for every platform (oxygen#59): scripts/dist.sh in the
77
// build image's cross toolchains. A push runs it only when it touches
78
// these paths (a release moves Cargo.toml's version); "Run pipeline" and
79
// reruns always do. The files are kept as this run's artifacts, named by
80
// its signed receipt, and attached to the release from there, so the
81
// release's trust page shows each as built here.
82
job "dist" {
83
    sandbox "rust"
84
    depends-on "fmt"
85
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**"
86
    mount {
87
        source "ephemeral://disk"
88
        target "/src/target"
89
        size "24GiB"
90
    }
91
    env {
92
        DIST_FLAT "/src/target/dist-flat"
93
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
94
    }
95
    exec "bash" "scripts/dist.sh"
96
    output {
97
        artifact "oxy-linux-x86_64.tar.gz" {
98
            path "/src/target/dist-flat/oxy-linux-x86_64.tar.gz"
99
        }
100
        artifact "oxy-linux-arm64.tar.gz" {
101
            path "/src/target/dist-flat/oxy-linux-arm64.tar.gz"
102
        }
103
        artifact "oxy-linux-riscv64.tar.gz" {
104
            path "/src/target/dist-flat/oxy-linux-riscv64.tar.gz"
105
        }
106
        artifact "oxy-macos-x86_64.tar.gz" {
107
            path "/src/target/dist-flat/oxy-macos-x86_64.tar.gz"
108
        }
109
        artifact "oxy-macos-arm64.tar.gz" {
110
            path "/src/target/dist-flat/oxy-macos-arm64.tar.gz"
111
        }
112
        artifact "oxy-windows-x86_64.zip" {
113
            path "/src/target/dist-flat/oxy-windows-x86_64.zip"
114
        }
115
        artifact "oxy_amd64.deb" {
116
            path "/src/target/dist-flat/oxy_amd64.deb"
117
        }
118
        artifact "oxy_arm64.deb" {
119
            path "/src/target/dist-flat/oxy_arm64.deb"
120
        }
121
        artifact "oxy_riscv64.deb" {
122
            path "/src/target/dist-flat/oxy_riscv64.deb"
123
        }
124
        artifact "SHA256SUMS" {
125
            path "/src/target/dist-flat/SHA256SUMS"
126
        }
127
    }
128
}