Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Rust ci is ported from run_ci.sh to run_ci.py #1332

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
LiangliangSui marked this conversation as resolved.
Show resolved Hide resolved
run: python ./ci/run_ci.py rust

cpp:
name: C++ CI
Expand Down
30 changes: 30 additions & 0 deletions ci/run_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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"]
Expand Down
Loading