commit e4474cfcda507dad97a65296d300833a2b2c67d1 Author: kjuulh Date: Thu May 18 15:07:24 2023 +0200 feat: add base bench diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37bfa82 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +.shuttle/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..3afe0a2 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "dagger-runtime-benchmark" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..27624f5 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "dagger-runtime-benchmark" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/actions/bench.go b/actions/bench.go new file mode 100644 index 0000000..99b3394 --- /dev/null +++ b/actions/bench.go @@ -0,0 +1,27 @@ +package main + +import ( + "context" + "log" + "os" + "os/exec" +) + +func Bench(ctx context.Context) error { + output, err := exec.Command("cargo", "build").CombinedOutput() + log.Println(string(output)) + if err != nil { + return err + } + + cmd := exec.Command("dagger", "run", "target/debug/dagger-runtime-benchmark") + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + if err = cmd.Run(); err != nil { + return err + } + + return nil +} diff --git a/actions/go.mod b/actions/go.mod new file mode 100644 index 0000000..35201f7 --- /dev/null +++ b/actions/go.mod @@ -0,0 +1,3 @@ +module actions + +go 1.20 diff --git a/shuttle.yaml b/shuttle.yaml new file mode 100644 index 0000000..fcea998 --- /dev/null +++ b/shuttle.yaml @@ -0,0 +1,3 @@ +plan: false +vars: + service: dagger-runtime-benchmark diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}