diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afcdb4aaee..973358f430 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 3d6f22fa10..205e5c103b 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"]