From a6c6023737b90308853b5981dce01ec6d0c952dc Mon Sep 17 00:00:00 2001 From: evenyag Date: Tue, 19 Apr 2022 18:41:20 +0800 Subject: [PATCH 1/3] feat: Init common crate --- Cargo.lock | 2 +- Cargo.toml | 12 ++++-------- src/common/Cargo.toml | 8 ++++++++ src/common/src/lib.rs | 1 + src/main.rs | 3 --- 5 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 src/common/Cargo.toml create mode 100644 src/common/src/lib.rs delete mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock index f9f7df81c9..db83ec7346 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,5 +3,5 @@ version = 3 [[package]] -name = "GrepTimeDB" +name = "common" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 96694aefc7..98944906e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,4 @@ -[package] -name = "greptime" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] +[workspace] +members = [ + "src/common" +] diff --git a/src/common/Cargo.toml b/src/common/Cargo.toml new file mode 100644 index 0000000000..b7723d9c7f --- /dev/null +++ b/src/common/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "common" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/common/src/lib.rs @@ -0,0 +1 @@ + diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index e7a11a969c..0000000000 --- a/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} From 7df913f803f5dbbc66af5d4cb4a16be85d70b6f4 Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 20 Apr 2022 10:43:02 +0800 Subject: [PATCH 2/3] build: Specific rust-toolchain (nightly-2022-04-03) --- rust-toolchain | 1 + 1 file changed, 1 insertion(+) create mode 100644 rust-toolchain diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000000..12f15f4d3c --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly-2022-04-03 From 39954289a009cc26d315f910af728eb47308838d Mon Sep 17 00:00:00 2001 From: evenyag Date: Wed, 20 Apr 2022 10:43:41 +0800 Subject: [PATCH 3/3] ci: Setup ci --- .github/workflows/develop.yml | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/develop.yml diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml new file mode 100644 index 0000000000..032bfb9fd6 --- /dev/null +++ b/.github/workflows/develop.yml @@ -0,0 +1,69 @@ +on: [push, pull_request] + +name: Continuous integration for developing + +env: + RUST_TOOLCHAIN: nightly-2022-04-03 + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets + + test: + name: Test Suite + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + args: --workspace + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --workspace --all-targets -- -D warnings