feat: with rust build and test
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
13
examples/rust-test/Cargo.toml
Normal file
13
examples/rust-test/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "rust-test"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
dagger-rust.workspace = true
|
||||
|
||||
eyre.workspace = true
|
||||
dagger-sdk.workspace = true
|
||||
tokio.workspace = true
|
16
examples/rust-test/src/main.rs
Normal file
16
examples/rust-test/src/main.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use dagger_rust::{build::RustVersion, test::RustTest};
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn main() -> eyre::Result<()> {
|
||||
let client = dagger_sdk::connect().await?;
|
||||
RustTest::new(client.clone())
|
||||
.test(
|
||||
Some("testdata"),
|
||||
RustVersion::Nightly,
|
||||
&["crates/*"],
|
||||
&["openssl"],
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
7
examples/rust-test/testdata/Cargo.lock
generated
vendored
Normal file
7
examples/rust-test/testdata/Cargo.lock
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "example_bin"
|
||||
version = "0.1.0"
|
3
examples/rust-test/testdata/Cargo.toml
vendored
Normal file
3
examples/rust-test/testdata/Cargo.toml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[workspace]
|
||||
members = ["crates/*"]
|
||||
resolver = "2"
|
1
examples/rust-test/testdata/crates/example_bin/.gitignore
vendored
Normal file
1
examples/rust-test/testdata/crates/example_bin/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target
|
8
examples/rust-test/testdata/crates/example_bin/Cargo.toml
vendored
Normal file
8
examples/rust-test/testdata/crates/example_bin/Cargo.toml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "example_bin"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
11
examples/rust-test/testdata/crates/example_bin/src/main.rs
vendored
Normal file
11
examples/rust-test/testdata/crates/example_bin/src/main.rs
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn test_main() {
|
||||
assert_eq!(1, 1)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user