[env]
DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/postgres"
[env.drone]
DATABASE_URL = "postgresql://postgres:postgres@postgres:5432/postgres"
[config]
default_to_workspace = false
[tasks.check]
description = "Run checks"
dependencies = ["check-no-features", "check-postgres"]
[tasks.check-no-features]
description = "Run check without features"
command = "cargo"
args = ["check", "--workspace"]
[tasks.check-postgres]
description = "Run check with `postgres` feature on"
command = "cargo"
args = ["check", "--workspace", "--features=postgres"]
[tasks.build-ci]
description = "Build prima_tracing.rs inside CI."
dependencies = ["build-ci-no-features", "build-ci-postgres"]
[tasks.build-ci-no-features]
description = "Build prima_tracing.rs inside CI."
command = "cargo"
args = ["build", "-j", "2", "--all-features", "--workspace"]
[tasks.build-ci-postgres]
description = "Build prima_tracing.rs inside CI."
command = "cargo"
args = ["build", "-j", "2", "--all-features", "--workspace"]
[tasks.format-ci]
description = "Runs the cargo rustfmt plugin during CI."
command = "cargo"
args = ["fmt", "--all", "--", "--check"]
[tasks.test]
description = "Run tests."
dependencies = ["test-no-features", "test-postgres"]
[tasks.test-no-features]
description = "Run tests."
command = "cargo"
args = ["test", "${@}", "--workspace"]
[tasks.test-postgres]
description = "Run tests."
command = "cargo"
args = ["test", "${@}", "--workspace", "--features=postgres"]
[tasks.clippy-ci]
description = "Run clippy linter."
dependencies = ["clippy-ci-no-features", "clippy-ci-postgres"]
[tasks.clippy-ci-no-features]
command = "cargo"
args = ["clippy", "--workspace", "--", "-D", "warnings"]
[tasks.clippy-ci-postgres]
command = "cargo"
args = ["clippy", "--workspace", "--features", "postgres", "--", "-D", "warnings"]
[tasks.example]
description = "Run given example."
command = "cargo"
args = ["run", "-p", "${@}"]
[tasks.docsrs]
description = "Build docs as they are rendered on docs.rs"
command = "cargo"
args = ["doc", "--all-features"]
[tasks.cargo-prune]
description = "Run cargo prune"
command = "cargo"
args = ["prune"]
[tasks.print-stats]
description = "Print cache size"
command = "du"
args = ["-sh", "target", ".cargo"]
[tasks.cache-cleanup]
description = "Clean CI cache"
dependencies = ["cargo-prune", "delete-artifacts", "print-stats"]
[tasks.delete-artifacts]
description = "Remove non cachable artifacts"
script = [
'''
#!/bin/bash
set -e
set -x
find ./target/debug -type f -maxdepth 1 -delete || true
rm -rf ./target/{debug,release}/deps/{*prima-tracing*}
rm -rf ./target/{debug,release}/.fingerprint/*prima-tracing*
''',
]