[env] DATABASE_URL = "postgresql://postgres:postgres@postgres:5432/postgres" RABBIT_URL = "amqp://rabbit:rabbit@rabbit:5672/rabbit" KAFKA_BROKERS_URL = "kafka:9092" [config] default_to_workspace = false # Check [tasks.check] description = "Run checks for each feature" dependencies = ["check-scripts"] [tasks.check-scripts] description = "Run checks for each feature" script = [ "cargo check", "cargo check --features=postgres", "cargo check --features=kafka", "cargo check --features=rabbit", "cargo check --features=rebuilder", "cargo check --features=upcasting", "cargo check --all-features" ] # Build [tasks.build] description = "Build the binaries for each feature" script = [ "cargo build -j 2", "cargo build -j 2 --features=postgres", "cargo build -j 2 --features=kafka", "cargo build -j 2 --features=rabbit", "cargo build -j 2 --features=rebuilder", "cargo build -j 2 --features=upcasting", "cargo build -j 2 --all-features" ] # Format [tasks.fmt-check] description = "Runs the cargo rustfmt plugin to check everything is well formatted" command = "cargo" args = ["fmt", "--all", "--", "--check"] # Tests [tasks.test] description = "Run tests" command = "cargo" args = ["test", "${@}", "--all-features"] # Clippy [tasks.clippy] description = "Run clippy linter" dependencies = ["clippy-scripts"] [tasks.clippy-scripts] description = "Run clippy linter" dependencies = ["fmt-check"] script = [ "cargo clippy -- -D warnings", "cargo clippy --features=postgres -- -D warnings", "cargo clippy --features=kafka -- -D warnings", "cargo clippy --features=rabbit -- -D warnings", "cargo clippy --features=rebuilder -- -D warnings", "cargo clippy --features=upcasting -- -D warnings", "cargo clippy --all-targets --all-features -- -D warnings" ] # Run example [tasks.examples] description = "Run all configured examples" script = [ "cargo run --example aggregate_deletion --features=postgres", "cargo run --example event_bus --features=postgres,rabbit,kafka", "cargo run --example eventual_view --features=postgres", "cargo run --example locking_strategies --features=postgres", "cargo run --example multi_aggregate_rebuild --features=postgres", "cargo run --example readme --features=postgres", "cargo run --example rebuilder --features=rebuilder,postgres", "cargo run --example saga --features=postgres", "cargo run --example schema --features=postgres", "cargo run --example shared_view --features=postgres", "cargo run --example store_crud --features=postgres", "cargo run --example transactional_view --features=postgres", "cargo run --example upcasting --features=postgres,upcasting", ] [tasks.clippy-examples] description = "Run clippy over all examples" script = [ "cargo clippy --example aggregate_deletion --features=postgres -- -D warnings", "cargo clippy --example event_bus --features=postgres,rabbit,kafka", "cargo clippy --example eventual_view --features=postgres -- -D warnings", "cargo clippy --example locking_strategies --features=postgres -- -D warnings", "cargo clippy --example multi_aggregate_rebuild --features=postgres -- -D warnings", "cargo clippy --example readme --features=postgres -- -D warnings", "cargo clippy --example rebuilder --features=rebuilder,postgres -- -D warnings", "cargo clippy --example saga --features=postgres -- -D warnings", "cargo clippy --example schema --features=postgres -- -D warnings", "cargo clippy --example shared_view --features=postgres -- -D warnings", "cargo clippy --example store_crud --features=postgres -- -D warnings", "cargo clippy --example transactional_view --features=postgres -- -D warnings", "cargo clippy --example upcasting --features=postgres,upcasting -- -D warnings", ] # Docs [tasks.docs] description = "Build docs as they are rendered on docs.rs" command = "cargo" args = ["doc", "--document-private-items", "--all-features", "--no-deps"] env = { "RUSTDOCFLAGS" = "-Dwarnings" } [tasks.release] description = "Task to release the package to crates.io" command = "cargo" args = ["publish", "--no-verify"]