OXYGENHUB
# f9eab8117787 oxygen / .flow / pipeline.kdl
4.3 KiB · last changed CI on the Rust image with cargo-nextest (refs #139) 11 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
// 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/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b"
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/836461b613019f62399a960c61a25c482eb74e30054ff2cd44d5594c3305872b"
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
// The tests, run under cargo-llvm-cov so the hub's Coverage tab
49
// (oxygenhub#113) gets a report: the same tests, instrumented, and an LCOV
50
// file kept as the job's `coverage` artifact.
51
job "test" {
52
    sandbox "rust"
53
    depends-on "fmt"
54
    mount {
55
        source "ephemeral://disk"
56
        target "/src/target"
57
        size "24GiB"
58
    }
59
    env {
60
        CARGO_INCREMENTAL "0"
61
    }
62
    exec "cargo" "llvm-cov" "--workspace" "--locked" "--lcov" "--output-path" "/src/target/lcov.info"
63
    output {
64
        artifact "coverage" {
65
            path "/src/target/lcov.info"
66
        }
67
    }
68
}
69
70
job "build" {
71
    sandbox "rust"
72
    depends-on "fmt"
73
    mount {
74
        source "ephemeral://disk"
75
        target "/src/target"
76
        size "24GiB"
77
    }
78
    env {
79
        CARGO_INCREMENTAL "0"
80
    }
81
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
82
}
83
84
// Release files for every platform (oxygen#59): scripts/dist.sh in the
85
// build image's cross toolchains. A push runs it only when it touches
86
// these paths (a release moves Cargo.toml's version); "Run pipeline" and
87
// reruns always do. The files are kept as this run's artifacts, named by
88
// its signed receipt, and attached to the release from there, so the
89
// release's trust page shows each as built here.
90
job "dist" {
91
    sandbox "rust"
92
    depends-on "fmt"
93
    scope "Cargo.toml" "scripts/dist.sh" "packaging/**"
94
    mount {
95
        source "ephemeral://disk"
96
        target "/src/target"
97
        size "24GiB"
98
    }
99
    env {
100
        DIST_FLAT "/src/target/dist-flat"
101
        ZIG_GLOBAL_CACHE_DIR "/src/target/zig-cache"
102
    }
103
    exec "bash" "scripts/dist.sh"
104
    output {
105
        artifact "oxy-linux-x86_64.tar.gz" {
106
            path "/src/target/dist-flat/oxy-linux-x86_64.tar.gz"
107
        }
108
        artifact "oxy-linux-arm64.tar.gz" {
109
            path "/src/target/dist-flat/oxy-linux-arm64.tar.gz"
110
        }
111
        artifact "oxy-linux-riscv64.tar.gz" {
112
            path "/src/target/dist-flat/oxy-linux-riscv64.tar.gz"
113
        }
114
        artifact "oxy-macos-x86_64.tar.gz" {
115
            path "/src/target/dist-flat/oxy-macos-x86_64.tar.gz"
116
        }
117
        artifact "oxy-macos-arm64.tar.gz" {
118
            path "/src/target/dist-flat/oxy-macos-arm64.tar.gz"
119
        }
120
        artifact "oxy-windows-x86_64.zip" {
121
            path "/src/target/dist-flat/oxy-windows-x86_64.zip"
122
        }
123
        artifact "oxy_amd64.deb" {
124
            path "/src/target/dist-flat/oxy_amd64.deb"
125
        }
126
        artifact "oxy_arm64.deb" {
127
            path "/src/target/dist-flat/oxy_arm64.deb"
128
        }
129
        artifact "oxy_riscv64.deb" {
130
            path "/src/target/dist-flat/oxy_riscv64.deb"
131
        }
132
        artifact "SHA256SUMS" {
133
            path "/src/target/dist-flat/SHA256SUMS"
134
        }
135
    }
136
}