solstice-ci/crates/runner-integration/build.rs
Till Wegmueller 70605a3c3a Add Forgejo Runner integration service
New crate that registers as a Forgejo Actions Runner, polls for tasks
via connect-rpc, translates them into Solstice JobRequests (with 3-tier
fallback: KDL workflow → Actions YAML run steps → unsupported error),
and reports results back to Forgejo.

Includes Containerfile and compose.yml service definition.
2026-04-06 23:34:53 +02:00

29 lines
1.1 KiB
Rust

fn main() {
println!("cargo:rerun-if-changed=proto/runner/v1/messages.proto");
println!("cargo:rerun-if-changed=proto/runner/v1/services.proto");
// Include system protobuf path for google/protobuf well-known types
// (e.g. /usr/include from protobuf-compiler in container builds).
let mut include_dirs = vec!["proto".to_string()];
for candidate in ["/usr/include", "/usr/local/include"] {
let p = std::path::Path::new(candidate).join("google/protobuf/timestamp.proto");
if p.exists() {
include_dirs.push(candidate.to_string());
break;
}
}
let include_refs: Vec<&str> = include_dirs.iter().map(|s| s.as_str()).collect();
tonic_prost_build::configure()
.build_server(false)
.build_client(false) // We implement connect-rpc transport manually
.compile_protos(
&[
"proto/runner/v1/messages.proto",
"proto/runner/v1/services.proto",
],
&include_refs,
)
.expect("failed to compile Forgejo actions proto");
}