OXYGENHUB
# 380996db84e5 +1 oxygenhub / .flow / pipeline.kdl
5.9 KiB · last changed ci: keep each build job's target from its last passing run (refs andymccall/oxygenflow#28) 25 days ago source blame history raw
This file is in conflict in this state; the markers below are the conflict. All conflicts
1
// OxygenHub's 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. oxygen and oxygenflow come
4
// from the pinned subrepos in deps/, which the runner puts in the workspace.
5
schema-version 1
6
7
// The OxygenFlow build image: Rust with rustfmt and clippy, Node, every
8
// crate of Cargo.lock vendored, and this workspace's dependencies prebuilt
9
// in /opt/warm/oxygenhub, which .flow/warm-target.sh copies onto a job's
10
// target disk (oxygenflow/images/rust). Rebuild and re-pin it when
11
// Cargo.lock changes; until then only the changed crates are compiled.
12
sandbox "rust" {
13
    runtime "microvm"
14
    rootfs "cas://blob/d2d24c2211f00d6ccf89fbee63095ad2a81d0cc9af92d7a0ede9129e18d46e91"
15
    memory-limit "8GiB"
16
    cpu-limit 4
17
    // Tests serve and connect on 127.0.0.1; nothing leaves the guest.
18
    network "loopback"
19
}
20
21
sandbox "rust-small" {
22
    runtime "microvm"
23
    rootfs "cas://blob/d2d24c2211f00d6ccf89fbee63095ad2a81d0cc9af92d7a0ede9129e18d46e91"
24
    memory-limit "1GiB"
25
    cpu-limit 1
26
    network "isolated"
27
}
28
29
job "fmt" {
30
    sandbox "rust-small"
31
    // Only this workspace's packages: --all would also check the path
32
    // dependencies in deps/, which follow their own formatting.
33
    exec "cargo" "fmt" "--check" "-p" "oxygenhub" "-p" "hub-api"
34
}
35
36
job "clippy" {
37
    sandbox "rust"
38
    depends-on "fmt"
39
    mount {
40
        source "ephemeral://disk"
41
        target "/src/target"
42
        size "24GiB"
43
        // Kept from this job's last passing run (oxygenflow#28): cargo
44
        // builds only what changed since.
45
        cache "target"
46
        key "Cargo.lock"
47
    }
48
<<<<<<< oxy conflict 1 of 3, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
49
    env {
50
        CARGO_INCREMENTAL "0"
51
    }
52
======= oxy conflict 1 of 3, side 2 of 2: change bce3997c "CI starts from the build image's prebuilt dependencies"
53
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
54
>>>>>>> oxy conflict 1 of 3 end
55
}
56
57
job "test" {
58
    sandbox "rust"
59
    depends-on "fmt"
60
    mount {
61
        source "ephemeral://disk"
62
        target "/src/target"
63
        size "24GiB"
64
        // Kept from this job's last passing run (oxygenflow#28): cargo
65
        // builds only what changed since.
66
        cache "target"
67
        key "Cargo.lock"
68
    }
69
<<<<<<< oxy conflict 2 of 3, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
70
    env {
71
        CARGO_INCREMENTAL "0"
72
    }
73
======= oxy conflict 2 of 3, side 2 of 2: change bce3997c "CI starts from the build image's prebuilt dependencies"
74
    exec "sh" ".flow/warm-target.sh" "cargo" "test" "--workspace" "--locked"
75
>>>>>>> oxy conflict 2 of 3 end
76
}
77
78
job "build" {
79
    sandbox "rust"
80
    depends-on "fmt"
81
    mount {
82
        source "ephemeral://disk"
83
        target "/src/target"
84
        size "24GiB"
85
<<<<<<< oxy conflict 3 of 3, side 1 of 2: change 6532b323 "oxygen and oxygenflow as pinned subrepos in deps/ (make pins moves them), and an OxygenFlow pipeline: fmt of this workspace, then clippy, tests and a release build against the pins"
86
    }
87
    env {
88
        CARGO_INCREMENTAL "0"
89
======= oxy conflict 3 of 3, side 2 of 2: change 5a69f07c "ci: keep each build job's target from its last passing run (refs andymccall/oxygenflow#28)"
90
        // Kept from this job's last passing run (oxygenflow#28): cargo
91
        // builds only what changed since.
92
        cache "target"
93
        key "Cargo.lock"
94
>>>>>>> oxy conflict 3 of 3 end
95
    }
96
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
97
}
98
99
// Release files for every platform (oxygen#59): scripts/dist.sh in the
100
// build image's cross toolchains. A push runs it only when it touches
101
// these paths (a release moves Cargo.toml's version); "Run pipeline" and
102
// reruns always do. The files are kept as this run's artifacts, named by
103
// its signed receipt, and attached to the release from there, so the
104
// release's trust page shows each as built here.
105
job "dist" {
106
    sandbox "rust"
107
    depends-on "fmt"
108
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**"
109
    mount {
110
        source "ephemeral://disk"
111
        target "/src/target"
112
        size "24GiB"
113
        // Kept from this job's last passing run (oxygenflow#28): cargo
114
        // builds only what changed since.
115
        cache "target"
116
        key "Cargo.lock"
117
    }
118
    env {
119
        DIST_FLAT "/src/target/dist-flat"
120
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
121
    }
122
    exec "bash" "scripts/dist.sh"
123
    output {
124
        artifact "oh-linux-x86_64.tar.gz" {
125
            path "/src/target/dist-flat/oh-linux-x86_64.tar.gz"
126
        }
127
        artifact "oh-linux-arm64.tar.gz" {
128
            path "/src/target/dist-flat/oh-linux-arm64.tar.gz"
129
        }
130
        artifact "oh-linux-riscv64.tar.gz" {
131
            path "/src/target/dist-flat/oh-linux-riscv64.tar.gz"
132
        }
133
        artifact "oh-macos-x86_64.tar.gz" {
134
            path "/src/target/dist-flat/oh-macos-x86_64.tar.gz"
135
        }
136
        artifact "oh-macos-arm64.tar.gz" {
137
            path "/src/target/dist-flat/oh-macos-arm64.tar.gz"
138
        }
139
        artifact "oh-windows-x86_64.zip" {
140
            path "/src/target/dist-flat/oh-windows-x86_64.zip"
141
        }
142
        artifact "oh_amd64.deb" {
143
            path "/src/target/dist-flat/oh_amd64.deb"
144
        }
145
        artifact "oh_arm64.deb" {
146
            path "/src/target/dist-flat/oh_arm64.deb"
147
        }
148
        artifact "oh_riscv64.deb" {
149
            path "/src/target/dist-flat/oh_riscv64.deb"
150
        }
151
        artifact "SHA256SUMS" {
152
            path "/src/target/dist-flat/SHA256SUMS"
153
        }
154
    }
155
}