Compare commits
No commits in common. "main" and "v0.3.0" have entirely different histories.
110
Cargo.lock
generated
110
Cargo.lock
generated
@ -99,6 +99,17 @@ version = "0.9.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
|
checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "async-scoped"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4042078ea593edffc452eef14e99fdb2b120caa4ad9618bcdeabc4a023b98740"
|
||||||
|
dependencies = [
|
||||||
|
"futures",
|
||||||
|
"pin-project",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.83"
|
version = "0.1.83"
|
||||||
@ -205,6 +216,22 @@ dependencies = [
|
|||||||
"windows-targets 0.52.6",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ci"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"async-scoped",
|
||||||
|
"clap",
|
||||||
|
"color-eyre",
|
||||||
|
"dagger-cuddle-please",
|
||||||
|
"dagger-rust",
|
||||||
|
"dagger-sdk",
|
||||||
|
"dotenv",
|
||||||
|
"eyre",
|
||||||
|
"futures",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.21"
|
version = "4.5.21"
|
||||||
@ -245,6 +272,33 @@ version = "0.7.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7"
|
checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "color-eyre"
|
||||||
|
version = "0.6.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5"
|
||||||
|
dependencies = [
|
||||||
|
"backtrace",
|
||||||
|
"color-spantrace",
|
||||||
|
"eyre",
|
||||||
|
"indenter",
|
||||||
|
"once_cell",
|
||||||
|
"owo-colors",
|
||||||
|
"tracing-error",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "color-spantrace"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"owo-colors",
|
||||||
|
"tracing-core",
|
||||||
|
"tracing-error",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "colorchoice"
|
name = "colorchoice"
|
||||||
version = "1.0.3"
|
version = "1.0.3"
|
||||||
@ -310,7 +364,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cuddle-ci"
|
name = "cuddle-ci"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -339,7 +393,7 @@ version = "0.1.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-cuddle-please"
|
name = "dagger-cuddle-please"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"dagger-sdk",
|
"dagger-sdk",
|
||||||
@ -348,7 +402,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-leptos"
|
name = "dagger-leptos"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"dagger-sdk",
|
"dagger-sdk",
|
||||||
@ -358,7 +412,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-rust"
|
name = "dagger-rust"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"dagger-sdk",
|
"dagger-sdk",
|
||||||
@ -510,6 +564,12 @@ dependencies = [
|
|||||||
"syn 2.0.87",
|
"syn 2.0.87",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dotenv"
|
||||||
|
version = "0.15.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.13.0"
|
version = "1.13.0"
|
||||||
@ -846,7 +906,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "htmx"
|
name = "htmx"
|
||||||
version = "0.3.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dagger-rust",
|
"dagger-rust",
|
||||||
"dagger-sdk",
|
"dagger-sdk",
|
||||||
@ -1286,6 +1346,12 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "owo-colors"
|
||||||
|
version = "3.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
version = "0.12.3"
|
version = "0.12.3"
|
||||||
@ -1315,6 +1381,26 @@ version = "2.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project"
|
||||||
|
version = "1.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95"
|
||||||
|
dependencies = [
|
||||||
|
"pin-project-internal",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project-internal"
|
||||||
|
version = "1.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.87",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-lite"
|
name = "pin-project-lite"
|
||||||
version = "0.2.15"
|
version = "0.2.15"
|
||||||
@ -1580,9 +1666,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.133"
|
version = "1.0.132"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
|
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@ -1957,6 +2043,16 @@ dependencies = [
|
|||||||
"valuable",
|
"valuable",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracing-error"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e"
|
||||||
|
dependencies = [
|
||||||
|
"tracing",
|
||||||
|
"tracing-subscriber",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-log"
|
name = "tracing-log"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = ["crates/*", "examples/*"]
|
members = ["crates/*", "examples/*", "ci"]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
@ -15,6 +15,7 @@ cuddle-components = { path = "crates/cuddle-components" }
|
|||||||
dagger-components = { path = "crates/dagger-components" }
|
dagger-components = { path = "crates/dagger-components" }
|
||||||
dagger-cuddle-please = { path = "crates/dagger-cuddle-please" }
|
dagger-cuddle-please = { path = "crates/dagger-cuddle-please" }
|
||||||
dagger-rust = { path = "crates/dagger-rust" }
|
dagger-rust = { path = "crates/dagger-rust" }
|
||||||
|
ci = { path = "ci" }
|
||||||
|
|
||||||
dagger-sdk = "0.13.7"
|
dagger-sdk = "0.13.7"
|
||||||
eyre = "0.6"
|
eyre = "0.6"
|
||||||
|
1861
ci/Cargo.lock
generated
Normal file
1861
ci/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
ci/Cargo.toml
Normal file
19
ci/Cargo.toml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[package]
|
||||||
|
name = "ci"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
dagger-cuddle-please.workspace = true
|
||||||
|
dagger-rust.workspace = true
|
||||||
|
dagger-sdk.workspace = true
|
||||||
|
|
||||||
|
eyre = "*"
|
||||||
|
color-eyre = "*"
|
||||||
|
tokio = "1"
|
||||||
|
clap = { version = "4", features = ["derive"] }
|
||||||
|
futures = "0.3"
|
||||||
|
async-scoped = { version = "0.9.0", features = ["tokio", "use-tokio"] }
|
||||||
|
dotenv.workspace = true
|
158
ci/src/main.rs
Normal file
158
ci/src/main.rs
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use clap::Args;
|
||||||
|
use clap::Parser;
|
||||||
|
use clap::Subcommand;
|
||||||
|
use clap::ValueEnum;
|
||||||
|
|
||||||
|
use crate::please_release::run_release_please;
|
||||||
|
|
||||||
|
#[derive(Parser, Clone)]
|
||||||
|
#[command(author, version, about, long_about = None, subcommand_required = true)]
|
||||||
|
pub struct Command {
|
||||||
|
#[command(subcommand)]
|
||||||
|
commands: Commands,
|
||||||
|
|
||||||
|
#[command(flatten)]
|
||||||
|
global: GlobalArgs,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand, Clone)]
|
||||||
|
pub enum Commands {
|
||||||
|
#[command(subcommand_required = true)]
|
||||||
|
Local {
|
||||||
|
#[command(subcommand)]
|
||||||
|
command: LocalCommands,
|
||||||
|
},
|
||||||
|
PullRequest {},
|
||||||
|
Main {},
|
||||||
|
Release,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand, Clone)]
|
||||||
|
pub enum LocalCommands {
|
||||||
|
Test,
|
||||||
|
PleaseRelease,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, ValueEnum)]
|
||||||
|
pub enum BuildProfile {
|
||||||
|
Debug,
|
||||||
|
Release,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Args)]
|
||||||
|
pub struct GlobalArgs {
|
||||||
|
#[arg(long, global = true, help_heading = "Global")]
|
||||||
|
dry_run: bool,
|
||||||
|
|
||||||
|
#[arg(long, global = true, help_heading = "Global")]
|
||||||
|
rust_builder_image: Option<String>,
|
||||||
|
|
||||||
|
#[arg(long, global = true, help_heading = "Global")]
|
||||||
|
cuddle_please_image: Option<String>,
|
||||||
|
|
||||||
|
#[arg(long, global = true, help_heading = "Global")]
|
||||||
|
source: Option<PathBuf>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() -> eyre::Result<()> {
|
||||||
|
let _ = dotenv::dotenv();
|
||||||
|
let _ = color_eyre::install();
|
||||||
|
|
||||||
|
let cli = Command::parse();
|
||||||
|
|
||||||
|
dagger_sdk::connect(|client| async move {
|
||||||
|
match &cli.commands {
|
||||||
|
Commands::Local { command } => match command {
|
||||||
|
LocalCommands::Test => {
|
||||||
|
test::execute(client, &cli.global).await?;
|
||||||
|
}
|
||||||
|
LocalCommands::PleaseRelease => todo!(),
|
||||||
|
},
|
||||||
|
Commands::PullRequest {} => {
|
||||||
|
async fn test(client: dagger_sdk::Query, cli: &Command) {
|
||||||
|
let args = &cli.global;
|
||||||
|
|
||||||
|
test::execute(client.clone(), args).await.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
tokio::join!(test(client.clone(), &cli),);
|
||||||
|
}
|
||||||
|
Commands::Main {} => {
|
||||||
|
async fn test(client: dagger_sdk::Query, cli: &Command) {
|
||||||
|
let args = &cli.global;
|
||||||
|
|
||||||
|
test::execute(client.clone(), args).await.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn cuddle_please(client: dagger_sdk::Query, cli: &Command) {
|
||||||
|
run_release_please(client.clone(), &cli.global)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
tokio::join!(
|
||||||
|
test(client.clone(), &cli),
|
||||||
|
cuddle_please(client.clone(), &cli)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Commands::Release => {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
mod please_release {
|
||||||
|
|
||||||
|
use dagger_cuddle_please::{models::CuddlePleaseSrcArgs, DaggerCuddlePleaseAction};
|
||||||
|
|
||||||
|
use crate::GlobalArgs;
|
||||||
|
|
||||||
|
pub async fn run_release_please(
|
||||||
|
client: dagger_sdk::Query,
|
||||||
|
args: &GlobalArgs,
|
||||||
|
) -> eyre::Result<()> {
|
||||||
|
DaggerCuddlePleaseAction::dagger(client)
|
||||||
|
.execute_src(&CuddlePleaseSrcArgs {
|
||||||
|
cuddle_image: args
|
||||||
|
.cuddle_please_image
|
||||||
|
.clone()
|
||||||
|
.unwrap_or("kasperhermansen/cuddle-please:latest".into()),
|
||||||
|
server: dagger_cuddle_please::models::SrcServer::Gitea {
|
||||||
|
token: std::env::var("CUDDLE_PLEASE_TOKEN")
|
||||||
|
.expect("CUDDLE_PLEASE_TOKEN to be present"),
|
||||||
|
},
|
||||||
|
log_level: Some(dagger_cuddle_please::models::LogLevel::Debug),
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod test {
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use dagger_rust::build::RustVersion;
|
||||||
|
|
||||||
|
use crate::GlobalArgs;
|
||||||
|
|
||||||
|
pub async fn execute(client: dagger_sdk::Query, _args: &GlobalArgs) -> eyre::Result<()> {
|
||||||
|
dagger_rust::test::RustTest::new(client)
|
||||||
|
.test(
|
||||||
|
None::<PathBuf>,
|
||||||
|
RustVersion::Nightly,
|
||||||
|
&["crates/*", "examples/*", "ci"],
|
||||||
|
&[],
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user