Skip to content

Commit

Permalink
feat(ci): Rust ci is ported from run_ci.sh to run_ci.py
Browse files Browse the repository at this point in the history
Signed-off-by: LiangliangSui <[email protected]>
  • Loading branch information
LiangliangSui committed Jan 11, 2024
1 parent 18527e3 commit 54fdf7e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ jobs:
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
Expand Down
29 changes: 29 additions & 0 deletions ci/run_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,27 @@ 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")
os.chdir(os.path.join(os.getcwd(), "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")
Expand Down Expand Up @@ -126,6 +147,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"]
Expand Down

0 comments on commit 54fdf7e

Please sign in to comment.