File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from harmont .py .uv import UvProject
66from harmont .rust import RustToolchain
77
8+ ALL_APT = (
9+ "curl" ,
10+ "ca-certificates" ,
11+ "build-essential" ,
12+ "pkg-config" ,
13+ "libssl-dev" ,
14+ "python3" ,
15+ "python3-venv" ,
16+ )
17+
18+
19+ @hm .target ()
20+ def shared_base () -> hm .Step :
21+ return hm .apt_base (packages = ALL_APT )
22+
823
924@hm .target ()
10- def rust_project () -> RustToolchain :
11- return hm .rust (path = "." )
25+ def rust_project (shared_base : hm . Target [ hm . Step ] ) -> RustToolchain :
26+ return hm .rust (path = "." , base = shared_base )
1227
1328
1429@hm .target ()
15- def py_project () -> UvProject :
16- return hm .py .uv (path = "dsls/harmont-py" )
30+ def py_project (shared_base : hm . Target [ hm . Step ] ) -> UvProject :
31+ return hm .py .uv (path = "dsls/harmont-py" , base = shared_base )
1732
1833
1934@hm .pipeline (
@@ -29,13 +44,16 @@ def ci(
2944 rust_project : hm .Target [RustToolchain ],
3045 py_project : hm .Target [UvProject ],
3146) -> tuple [hm .Step , ...]:
47+ warm = rust_project .warmup ()
3248 return (
33- rust_project .build (),
34- rust_project .installed .sh (
35- ". $HOME/.cargo/env && cd . && cargo test --lib" ,
49+ warm .sh (
50+ ". $HOME/.cargo/env && cd . && cargo test --workspace --locked --no-fail-fast" ,
3651 label = ":rust: test" ,
3752 ),
38- rust_project .clippy (),
53+ warm .sh (
54+ ". $HOME/.cargo/env && cd . && cargo clippy --workspace --tests --locked -- -D warnings" ,
55+ label = ":rust: clippy" ,
56+ ),
3957 rust_project .fmt (),
4058 py_project .lint (),
4159 py_project .fmt (),
Original file line number Diff line number Diff line change 1- import { pipeline , push , pullRequest , type PipelineDefinition } from "harmont" ;
1+ import {
2+ pipeline ,
3+ push ,
4+ pullRequest ,
5+ aptBase ,
6+ type PipelineDefinition ,
7+ } from "harmont" ;
28import { rust , py } from "harmont/toolchains" ;
39
4- const rustProject = rust ( { path : "." } ) ;
5- const pyProject = py . uv ( { path : "dsls/harmont-py" } ) ;
10+ const ALL_APT = [
11+ "curl" ,
12+ "ca-certificates" ,
13+ "build-essential" ,
14+ "pkg-config" ,
15+ "libssl-dev" ,
16+ "python3" ,
17+ "python3-venv" ,
18+ ] as const ;
19+
20+ const base = aptBase ( { packages : ALL_APT } ) ;
21+ const rustProject = rust ( { path : "." , base } ) ;
22+ const pyProject = py . uv ( { path : "dsls/harmont-py" , base } ) ;
23+
24+ const warm = rustProject . warmup ( ) ;
625
726const pipelines : PipelineDefinition [ ] = [
827 {
928 slug : "ci" ,
1029 triggers : [ push ( { branch : "main" } ) , pullRequest ( { branches : [ "main" ] } ) ] ,
1130 pipeline : pipeline (
12- rustProject . build ( ) ,
13- rustProject . install ( ) . sh ( `. $HOME/.cargo/env && cd . && cargo test --lib` , { label : ":rust: test" } ) ,
14- rustProject . clippy ( ) ,
31+ warm . sh (
32+ `. $HOME/.cargo/env && cd . && cargo test --workspace --locked --no-fail-fast` ,
33+ { label : ":rust: test" } ,
34+ ) ,
35+ warm . sh (
36+ `. $HOME/.cargo/env && cd . && cargo clippy --workspace --tests --locked -- -D warnings` ,
37+ { label : ":rust: clippy" } ,
38+ ) ,
1539 rustProject . fmt ( ) ,
1640 pyProject . lint ( ) ,
1741 pyProject . fmt ( ) ,
You can’t perform that action at this time.
0 commit comments