From f2db7fc53bf3168fa4d4f17a6e1cead5d450b818 Mon Sep 17 00:00:00 2001 From: Jax Liu Date: Thu, 26 Dec 2024 13:51:31 +0800 Subject: [PATCH 1/3] chore(ci): simplify the ci and image building --- .github/workflows/build-image.yml | 4 +- .github/workflows/wren-core-base.yml | 129 ++++++++++++++++++ .github/workflows/{rust.yml => wren-core.yml} | 27 ---- .gitignore | 1 + 4 files changed, 131 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/wren-core-base.yml rename .github/workflows/{rust.yml => wren-core.yml} (82%) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 9e7ca9c35..f125d275a 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -78,7 +78,7 @@ jobs: uses: docker/build-push-action@v5 with: context: ./docker - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 tags: ${{ steps.meta.outputs.tags }} build-args: | WREN_VERSION=${{ steps.prepare.outputs.WREN_VERSION }} @@ -91,8 +91,6 @@ jobs: arch: - runner: ubuntu-latest platform: linux/amd64 - - runner: linux_arm64_runner - platform: linux/arm64 runs-on: ${{ matrix.arch.runner }} steps: - name: Prepare platform diff --git a/.github/workflows/wren-core-base.yml b/.github/workflows/wren-core-base.yml new file mode 100644 index 000000000..512798b33 --- /dev/null +++ b/.github/workflows/wren-core-base.yml @@ -0,0 +1,129 @@ +name: Rust + +on: + pull_request: + paths: + - 'wren-core-base/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }} + cancel-in-progress: true + +defaults: + run: + working-directory: wren-core-base + +jobs: + # Check crate compiles + linux-build-lib: + name: cargo check + runs-on: ubuntu-latest + container: + image: amd64/rust + steps: + - uses: actions/checkout@v4 + - name: Setup Rust toolchain + uses: ./.github/actions/rust/setup-builder + with: + rust-version: stable + + - name: Cache Cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ./wren-core/target/ + # this key equals the ones on `linux-build-lib` for re-use + key: cargo-cache-benchmark-${{ hashFiles('wren-core/Cargo.toml') }} + + - name: Check datafusion-common without default features + run: cargo check --all-targets + + # Run tests + linux-test: + name: cargo test (amd64) + needs: [ linux-build-lib ] + runs-on: ubuntu-latest + container: + image: amd64/rust + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Rust toolchain + uses: ./.github/actions/rust/setup-builder + with: + rust-version: stable + - name: Run tests (excluding doctests) + run: cargo test --lib --tests --bins + - name: Verify Working Directory Clean + run: git diff --exit-code + + macos-aarch64: + name: cargo test (macos-aarch64) + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Rust toolchain + uses: ./.github/actions/rust/setup-macos-aarch64-builder + - name: Run tests (excluding doctests) + shell: bash + run: cargo test --lib --tests --bins + + check-fmt: + name: Check cargo fmt + runs-on: ubuntu-latest + container: + image: amd64/rust + steps: + - uses: actions/checkout@v4 + - name: Setup Rust toolchain + uses: ./.github/actions/rust/setup-builder + with: + rust-version: stable + - name: Run + run: cargo fmt --all -- --check + + clippy: + name: clippy + needs: [ linux-build-lib ] + runs-on: ubuntu-latest + container: + image: amd64/rust + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Rust toolchain + uses: ./.github/actions/rust/setup-builder + with: + rust-version: stable + - name: Install Clippy + run: rustup component add clippy + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings + + cargo-toml-formatting-checks: + name: check Cargo.toml formatting + needs: [ linux-build-lib ] + runs-on: ubuntu-latest + container: + image: amd64/rust + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Setup Rust toolchain + uses: ./.github/actions/rust/setup-builder + with: + rust-version: stable + - name: Install taplo + run: cargo +stable install taplo-cli --version ^0.9 --locked + # if you encounter an error, try running 'taplo format' to fix the formatting automatically. + - name: Check Cargo.toml formatting + run: taplo format --check diff --git a/.github/workflows/rust.yml b/.github/workflows/wren-core.yml similarity index 82% rename from .github/workflows/rust.yml rename to .github/workflows/wren-core.yml index 937dd313b..13e7ff79a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/wren-core.yml @@ -62,33 +62,6 @@ jobs: - name: Verify Working Directory Clean run: git diff --exit-code - windows: - name: cargo test (win64) - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup Rust toolchain - uses: ./.github/actions/rust/setup-windows-builder - - name: Run tests (excluding doctests) - shell: bash - run: | - cargo test --lib --tests --bins - - macos: - name: cargo test (macos) - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup Rust toolchain - uses: ./.github/actions/rust/setup-macos-builder - - name: Run tests (excluding doctests) - shell: bash - run: cargo test --lib --tests --bins - macos-aarch64: name: cargo test (macos-aarch64) runs-on: macos-14 diff --git a/.gitignore b/.gitignore index 4f662d86a..7e4a34323 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ wren-server/etc __pycache__/ venv/ **/.env* +**/.venv/ **/*.so From 9cc2356227d0ffbdf8134353cdc4aa1f5c5f799b Mon Sep 17 00:00:00 2001 From: Jax Liu Date: Thu, 26 Dec 2024 13:58:27 +0800 Subject: [PATCH 2/3] fix the path --- .github/workflows/wren-core-base.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wren-core-base.yml b/.github/workflows/wren-core-base.yml index 512798b33..8ce0d59cc 100644 --- a/.github/workflows/wren-core-base.yml +++ b/.github/workflows/wren-core-base.yml @@ -35,9 +35,9 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - ./wren-core/target/ + ./wren-core-base/target/ # this key equals the ones on `linux-build-lib` for re-use - key: cargo-cache-benchmark-${{ hashFiles('wren-core/Cargo.toml') }} + key: cargo-cache-benchmark-${{ hashFiles('wren-core-base/Cargo.toml') }} - name: Check datafusion-common without default features run: cargo check --all-targets From 668d979dd1145c0ef78818be66f30057d0ec1811 Mon Sep 17 00:00:00 2001 From: Jax Liu Date: Thu, 26 Dec 2024 14:13:59 +0800 Subject: [PATCH 3/3] fix action name --- .github/workflows/wren-core-base.yml | 2 +- .github/workflows/wren-core.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wren-core-base.yml b/.github/workflows/wren-core-base.yml index 8ce0d59cc..59f0436ab 100644 --- a/.github/workflows/wren-core-base.yml +++ b/.github/workflows/wren-core-base.yml @@ -39,7 +39,7 @@ jobs: # this key equals the ones on `linux-build-lib` for re-use key: cargo-cache-benchmark-${{ hashFiles('wren-core-base/Cargo.toml') }} - - name: Check datafusion-common without default features + - name: Check all target run: cargo check --all-targets # Run tests diff --git a/.github/workflows/wren-core.yml b/.github/workflows/wren-core.yml index 13e7ff79a..1741e8fac 100644 --- a/.github/workflows/wren-core.yml +++ b/.github/workflows/wren-core.yml @@ -39,7 +39,7 @@ jobs: # this key equals the ones on `linux-build-lib` for re-use key: cargo-cache-benchmark-${{ hashFiles('wren-core/Cargo.toml') }} - - name: Check datafusion-common without default features + - name: Check all targets run: cargo check --all-targets # Run tests