diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 545bc57..0c5544d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,9 +2,8 @@ name: Release on: push: - # Pattern matched against refs/tags tags: - - '*' # Push events to every tag not containing / + - 'v*' # Push events to every tag not containing / workflow_dispatch: jobs: @@ -22,6 +21,8 @@ jobs: toolchain: stable override: true - - run: cargo publish + - name: Publish sqlness + run: cargo publish + working-directory: sqlness env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index dd1580b..668a702 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,27 +1,14 @@ -[package] -name = "sqlness" -version = "0.4.0" +[workspace] +members = ["sqlness", "sqlness-cli"] + +[workspace.package] +version = "0.4.1" edition = "2021" authors = [ "CeresDB Authors ", "Ruihang Xia ", ] repository = "https://github.com/CeresDB/sqlness" +homepage = "https://github.com/CeresDB/sqlness" license = "Apache-2.0" -description = "SQL integration test harness" - -[dependencies] -async-trait = "0.1" -derive_builder = "0.11" -mysql = { version = "23.0.1", optional = true } -prettydiff = "0.6.2" -serde = { version = "1.0", features = ["derive"] } -thiserror = "1.0" -toml = "0.5" -walkdir = "2.3" - -[dev-dependencies] -tokio = { version = "1.23", features = ["full"] } - -[features] -default = [] +keywords = ["sql", "database", "cli"] diff --git a/Makefile b/Makefile index b65b6f0..0bdb0cc 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,10 @@ clippy: cd $(DIR); cargo clippy --all-targets --all-features --workspace -- -D warnings basic-example: - cd $(DIR); cargo run --example basic + cd $(DIR)/sqlness; cargo run --example basic bad-example: - cd $(DIR); cargo run --example bad + cd $(DIR)/sqlness; cargo run --example bad cli-test: - cd $(DIR)/cli; cargo run -- -c tests -i 127.0.0.1 -p 3306 -u root -P 1a2b3c -d public + cd $(DIR)/sqlness-cli; cargo run -- -c tests -i 127.0.0.1 -p 3306 -u root -P 1a2b3c -d public diff --git a/cli/Cargo.toml b/cli/Cargo.toml deleted file mode 100644 index cd31da0..00000000 --- a/cli/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "sqlness-cli" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -async-trait = "0.1.64" -clap = { version = "4.1.8", features = [ "derive" ] } -futures = "0.3.26" -sqlness = { path = "..", features = [ "mysql" ] } diff --git a/sqlness-cli/Cargo.toml b/sqlness-cli/Cargo.toml new file mode 100644 index 00000000..8f0e743 --- /dev/null +++ b/sqlness-cli/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "sqlness-cli" +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +keywords = { workspace = true } +license = { workspace = true } +repository = { workspace = true } +description = "Sqlness command line tool" + +[dependencies] +async-trait = "0.1.64" +clap = { version = "4.1.8", features = [ "derive" ] } +futures = "0.3.26" +sqlness = { path = "../sqlness", features = [ "mysql" ] } diff --git a/cli/src/main.rs b/sqlness-cli/src/main.rs similarity index 100% rename from cli/src/main.rs rename to sqlness-cli/src/main.rs diff --git a/cli/tests/local/input.result b/sqlness-cli/tests/local/input.result similarity index 100% rename from cli/tests/local/input.result rename to sqlness-cli/tests/local/input.result diff --git a/cli/tests/local/input.sql b/sqlness-cli/tests/local/input.sql similarity index 100% rename from cli/tests/local/input.sql rename to sqlness-cli/tests/local/input.sql diff --git a/sqlness/Cargo.toml b/sqlness/Cargo.toml new file mode 100644 index 00000000..7728d7f --- /dev/null +++ b/sqlness/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "sqlness" +description = "SQL integration test harness" +version = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +keywords = { workspace = true } +license = { workspace = true } +repository = { workspace = true } + +[dependencies] +async-trait = "0.1" +derive_builder = "0.11" +mysql = { version = "23.0.1", optional = true } +prettydiff = "0.6.2" +serde = { version = "1.0", features = ["derive"] } +thiserror = "1.0" +toml = "0.5" +walkdir = "2.3" + +[dev-dependencies] +tokio = { version = "1.23", features = ["full"] } + +[features] +default = [] diff --git a/examples/bad-case/simple/select.result b/sqlness/examples/bad-case/simple/select.result similarity index 100% rename from examples/bad-case/simple/select.result rename to sqlness/examples/bad-case/simple/select.result diff --git a/examples/bad-case/simple/select.sql b/sqlness/examples/bad-case/simple/select.sql similarity index 100% rename from examples/bad-case/simple/select.sql rename to sqlness/examples/bad-case/simple/select.sql diff --git a/examples/bad.rs b/sqlness/examples/bad.rs similarity index 100% rename from examples/bad.rs rename to sqlness/examples/bad.rs diff --git a/examples/basic-case/simple/config.toml b/sqlness/examples/basic-case/simple/config.toml similarity index 100% rename from examples/basic-case/simple/config.toml rename to sqlness/examples/basic-case/simple/config.toml diff --git a/examples/basic-case/simple/select.result b/sqlness/examples/basic-case/simple/select.result similarity index 100% rename from examples/basic-case/simple/select.result rename to sqlness/examples/basic-case/simple/select.result diff --git a/examples/basic-case/simple/select.sql b/sqlness/examples/basic-case/simple/select.sql similarity index 100% rename from examples/basic-case/simple/select.sql rename to sqlness/examples/basic-case/simple/select.sql diff --git a/examples/basic.rs b/sqlness/examples/basic.rs similarity index 100% rename from examples/basic.rs rename to sqlness/examples/basic.rs diff --git a/examples/basic.toml b/sqlness/examples/basic.toml similarity index 100% rename from examples/basic.toml rename to sqlness/examples/basic.toml diff --git a/examples/interceptor-arg/simple/input.result b/sqlness/examples/interceptor-arg/simple/input.result similarity index 100% rename from examples/interceptor-arg/simple/input.result rename to sqlness/examples/interceptor-arg/simple/input.result diff --git a/examples/interceptor-arg/simple/input.sql b/sqlness/examples/interceptor-arg/simple/input.sql similarity index 100% rename from examples/interceptor-arg/simple/input.sql rename to sqlness/examples/interceptor-arg/simple/input.sql diff --git a/examples/interceptor_arg.rs b/sqlness/examples/interceptor_arg.rs similarity index 100% rename from examples/interceptor_arg.rs rename to sqlness/examples/interceptor_arg.rs diff --git a/src/case.rs b/sqlness/src/case.rs similarity index 100% rename from src/case.rs rename to sqlness/src/case.rs diff --git a/src/config.rs b/sqlness/src/config.rs similarity index 100% rename from src/config.rs rename to sqlness/src/config.rs diff --git a/src/database.rs b/sqlness/src/database.rs similarity index 100% rename from src/database.rs rename to sqlness/src/database.rs diff --git a/src/database_impl/mod.rs b/sqlness/src/database_impl/mod.rs similarity index 100% rename from src/database_impl/mod.rs rename to sqlness/src/database_impl/mod.rs diff --git a/src/database_impl/mysql.rs b/sqlness/src/database_impl/mysql.rs similarity index 100% rename from src/database_impl/mysql.rs rename to sqlness/src/database_impl/mysql.rs diff --git a/src/environment.rs b/sqlness/src/environment.rs similarity index 100% rename from src/environment.rs rename to sqlness/src/environment.rs diff --git a/src/error.rs b/sqlness/src/error.rs similarity index 100% rename from src/error.rs rename to sqlness/src/error.rs diff --git a/src/interceptor.rs b/sqlness/src/interceptor.rs similarity index 100% rename from src/interceptor.rs rename to sqlness/src/interceptor.rs diff --git a/src/interceptor/arg.rs b/sqlness/src/interceptor/arg.rs similarity index 100% rename from src/interceptor/arg.rs rename to sqlness/src/interceptor/arg.rs diff --git a/src/lib.rs b/sqlness/src/lib.rs similarity index 100% rename from src/lib.rs rename to sqlness/src/lib.rs diff --git a/src/runner.rs b/sqlness/src/runner.rs similarity index 100% rename from src/runner.rs rename to sqlness/src/runner.rs