OXYGENHUB
# b6dfcb61cf5e oxygenhub / .flow / pipeline.kdl
3.9 KiB · last changed A test report and coverage from the hub's CI (closes #307) 11 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/9d76e1aef3ab096c57dfdab6ed2cfb4de1dc70e67ca0e7f299e087f7abb7e61a"
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/9d76e1aef3ab096c57dfdab6ed2cfb4de1dc70e67ca0e7f299e087f7abb7e61a"
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" "-p" "oh"
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
    }
44
<<<<<<< oxy conflict 1 of 2, 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"
45
    env {
46
        CARGO_INCREMENTAL "0"
47
    }
48
======= oxy conflict 1 of 2, side 2 of 2: change bce3997c "CI starts from the build image's prebuilt dependencies"
49
    exec "sh" ".flow/warm-target.sh" "cargo" "clippy" "--workspace" "--all-targets" "--locked" "--" "-D" "warnings"
50
>>>>>>> oxy conflict 1 of 2 end
51
}
52
53
job "test" {
54
    sandbox "rust"
55
    depends-on "fmt"
56
    mount {
57
        source "ephemeral://disk"
58
        target "/src/target"
59
        size "24GiB"
60
    }
61
<<<<<<< oxy conflict 2 of 2, 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"
62
    env {
63
        CARGO_INCREMENTAL "0"
64
    }
65
======= oxy conflict 2 of 2, side 2 of 2: change 28570ce2 "A test report and coverage from the hub's CI (closes #307)"
66
    // Under cargo-nextest (#307): a JUnit report for the hub's Tests tab,
67
    // kept whether or not the tests pass.
68
    exec "sh" ".flow/warm-target.sh" "cargo" "nextest" "run" "--workspace" "--locked" "--profile" "ci"
69
    output {
70
        artifact "junit" {
71
            path "/src/target/nextest/ci/junit.xml"
72
            when "always"
73
        }
74
    }
75
}
76
77
// Line coverage (#307) for the Coverage tab: the tests again, instrumented,
78
// in a job of its own beside `test`, so neither waits for the other and the
79
// instrumented build keeps its own cached target. Not a required check.
80
job "coverage" {
81
    sandbox "rust"
82
    depends-on "fmt"
83
    mount {
84
        source "ephemeral://disk"
85
        target "/src/target"
86
        size "48GiB"
87
        cache "coverage-target"
88
        key "Cargo.lock"
89
    }
90
    exec "cargo" "llvm-cov" "nextest" "--workspace" "--locked" "--profile" "ci" "--lcov" "--output-path" "/src/target/lcov.info"
91
    output {
92
        artifact "coverage" {
93
            path "/src/target/lcov.info"
94
        }
95
    }
96
>>>>>>> oxy conflict 2 of 2 end
97
}
98
99
job "build" {
100
    sandbox "rust"
101
    depends-on "fmt"
102
    mount {
103
        source "ephemeral://disk"
104
        target "/src/target"
105
        size "24GiB"
106
    }
107
    env {
108
        CARGO_INCREMENTAL "0"
109
    }
110
    exec "sh" ".flow/warm-target.sh" "cargo" "build" "--release" "--locked"
111
}