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 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/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000000..12f15f4d3c --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly-2022-04-03 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!"); -}