- Creating a basic artimetric calculator as a command-line tool using the Rust programming language, and setting up CI/CD with GitHub
- Package a Rust script with setuptools or a similar tool
- Include a user guide on how to install and use the tool
- Package tool
- Written Guide
- Binary file as an artifact in CI/CD
Mini_PJT_7_Rust_Pilot_ISL
├─ .devcontainer
│ ├─ Dockerfile
│ └─ devcontainer.json
├─ .github
│ └─ workflows
│ └─ CICD.yaml
├─ .gitignore
├─ Cargo.toml
├─ Makefile
├─ README.md
└─ src
└─ main.rs
-
Cargo.tolm
: Essential for configuring a Rust project. It defines project metadata such as name, version, dependencies, and edition. -
main.rs
: The Rust source code that perfoms basic arithmetic operations (addition, subtraction, multiplication, division) using command-line argument parsing. It also includes unit tests to verify the correctness of each arithmetic function.
-
[1] Rust installation (MacOS) * Check the installed version with
rust --version
in command linecurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
[2]
Clap
Dependency : Used to parse command-line argument. EnsureCargo.toml
file includes as following code[dependencies] clap = { version = "4.5.20", features = ["derive"] }
-
[3] Compile the project : Compiles the project's source code, manages dependency and generates artifact
cargo build
-
[4] Run the code : Perform basic arithmetric operations using two numbers and a chosen operation. [operation] :
add
,multiply
,subtract
,divide
[num1], [num2] : Put numbers to calculatecargo run -- [operation] [num1] [num2]
-
[5] Testing & Linting & Formatting : Run the following tools via the
Makefile
- format :
cargo fmt
, lint:cargo clippy
, test:cargo test
, check:cargo check
- format :
- Binary file as an artifact in CI/CD
- Binary file is successfully released