Skip to content

Commit

Permalink
user_guide_added
Browse files Browse the repository at this point in the history
  • Loading branch information
Afag Ramazanova authored and Afag Ramazanova committed Oct 23, 2024
1 parent e9161ae commit 7025d29
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ This project demonstrates the creation of a simple multiplication tool using the
- GitHub Actions: Used to automate the testing, building, and artifact uploading processes for the CI/CD pipeline.
- Docker (if applicable): Can be used to containerize the application for easy deployment and scalability.

# Getting Started

## Prerequisites
# Prerequisites

To run this project locally, you need to have the following tools installed:

Expand All @@ -27,6 +26,10 @@ This project is equipped with a CI/CD pipeline using GitHub Actions, which autom

- Testing: The project is tested automatically on each push.
- Building: The code is compiled into a binary in release mode.
- Artifact Upload: The generated binary is uploaded as an artifact, allowing users to download and run the compiled program.



## Binary artifact

- Artifact Upload: The generated binary can be found in teh actions tab of the repository, inside the upload binary step of the yml file. You can download it and use that.

Binary file added multiplication2-2
Binary file not shown.
90 changes: 90 additions & 0 deletions user_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
### User Guide: Command-Line Calculator in Rust

#### Overview
This Rust-based tool is designed to perform multiplication operations. The tool takes two input values, multiplies them, and returns the product. It is built with Rust and includes CI/CD integration for automated testing and building.


#### Prerequisites
Before running the program, ensure the following are set up:

1. **Step 1: Install Rust**: Ensure Rust is installed. Here are the detailed steps for installing **rust**

- Open your terminal and run

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

- Verify the installation by checking the Rust version:

```bash
rustc --version
```

Cargo: Installed along with Rust as its package manager.


#### Usage Instructions

1. **Navigate to the Project Directory**:
Make sure you're in the correct directory where the `Cargo.toml` file is located. You can do this with the following command:

```bash
cd /path/to/your/rust/project
```

2. **Building a project**:
Once inside the project directory, build the project using Cargo:

```bash
cargo build
```
For a release build:
```bash
cargo build --release
```
This will generate the binary in the target/debug/ or target/release/ directory, depending on the build mode you choose.

3. **Run the Program**:
After building the project, you can run the program by executing:

### Command Syntax:
```bash
cargo run -- <operation> <num1> <num2>
```

Or if using the release build:
```bash
./target/release/<operation>
```


Where <operation> is the name of your binary, typically matching the package name defined in Cargo.toml.

#### Usage

This tool performs multiplication of two numbers. It reads the numbers from the command line or standard input.

```bash
cargo run -- multiplication 6 4
```
**Output**:
```
The multiplication of 6 and 4 is 24
```
You can modify the input numbers to perform other multiplication operations.

#### Running Tests
This project includes automated tests to ensure the multiplication functionality is working correctly.
```bash
cargo test
```
The test results will be displayed in the terminal, showing whether the tests passed or failed.

#### CI/CD Pipeline

This project is equipped with a CI/CD pipeline using GitHub Actions, which automates the following tasks:

- Testing: The project is tested automatically on each push.
- Building: The code is compiled into a binary in release mode.
- Artifact Upload: The built binary is uploaded as an artifact, allowing users to download and run the compiled program.

0 comments on commit 7025d29

Please sign in to comment.