You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by ch...@apache.org on 2024/01/17 04:07:16 UTC

(incubator-fury) branch main updated: feat(ci): Rust ci is ported from run_ci.sh to run_ci.py (#1332)

This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-fury.git


The following commit(s) were added to refs/heads/main by this push:
     new 9ec9adc4 feat(ci): Rust ci is ported from run_ci.sh to run_ci.py (#1332)
9ec9adc4 is described below

commit 9ec9adc482afb9316317fae95b254e452d901c06
Author: LiangliangSui <11...@users.noreply.github.com>
AuthorDate: Wed Jan 17 12:07:13 2024 +0800

    feat(ci): Rust ci is ported from run_ci.sh to run_ci.py (#1332)
    
    Rust ci is ported from `run_ci.sh` to `run_ci.py`.
    
    Signed-off-by: LiangliangSui <co...@gmail.com>
---
 .github/workflows/ci.yml |  8 ++++++--
 ci/run_ci.py             | 30 ++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index afcdb4aa..973358f4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -122,12 +122,16 @@ jobs:
 
   rust:
     name: Rust CI
-    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-2022]
+    runs-on: ${{ matrix.os }}
     timeout-minutes: 45
     steps:
       - uses: actions/checkout@v3
       - uses: dtolnay/rust-toolchain@nightly
-      - run: ./ci/run_ci.sh rust
+      - name: Run Rust CI
+        run: python ./ci/run_ci.py rust
 
   cpp:
     name: C++ CI
diff --git a/ci/run_ci.py b/ci/run_ci.py
index 3d6f22fa..205e5c10 100644
--- a/ci/run_ci.py
+++ b/ci/run_ci.py
@@ -80,6 +80,28 @@ def _run_cpp():
     )
 
 
+def _run_rust():
+    _exec_cmd("rustup component add clippy-preview")
+    _exec_cmd("rustup component add rustfmt")
+    logging.info("Executing fury rust tests")
+    cur_script_abs_path = os.path.split(os.path.realpath(__file__))[0]
+    os.chdir(os.path.join(cur_script_abs_path, "../rust"))
+
+    cmds = (
+        "cargo doc --no-deps --document-private-items --all-features --open",
+        "cargo fmt --all -- --check",
+        "cargo fmt --all",
+        "cargo clippy --workspace --all-features --all-targets",
+        "cargo doc",
+        "cargo build --all-features --all-targets",
+        "cargo test",
+        "cargo clean",
+    )
+    for cmd in cmds:
+        _exec_cmd(cmd)
+    logging.info("Executing fury rust tests succeeds")
+
+
 def _install_cpp_deps():
     _exec_cmd(f"pip install pyarrow=={PYARROW_VERSION}")
     _exec_cmd("pip install psutil")
@@ -126,6 +148,14 @@ def _parse_args():
     )
     cpp_parser.set_defaults(func=_run_cpp)
 
+    rust_parser = subparsers.add_parser(
+        "rust",
+        description="Run Rust CI",
+        help="Run Rust CI",
+        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+    )
+    rust_parser.set_defaults(func=_run_rust)
+
     args = parser.parse_args()
     arg_dict = dict(vars(args))
     del arg_dict["func"]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org