Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jotavare/github-actions-overview
Test example with math functions in C and CI with GitHub Actions.
https://github.com/jotavare/github-actions-overview
c cd ci functions github-actions math
Last synced: 7 days ago
JSON representation
Test example with math functions in C and CI with GitHub Actions.
- Host: GitHub
- URL: https://github.com/jotavare/github-actions-overview
- Owner: jotavare
- License: mit
- Created: 2024-06-02T16:04:55.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-27T00:20:17.000Z (7 months ago)
- Last Synced: 2024-11-08T23:33:26.645Z (2 months ago)
- Topics: c, cd, ci, functions, github-actions, math
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ABOUT
This repository contains basic math functions (add, subtract, multiply, divide) written in C and a test example to ensure their correctness. It also includes a GitHub Actions workflow for continuous integration (CI) to automatically compile and test the code.
## FILES
- `math.c`: Contains the implementation of the math functions.
- `math.h`: Header file declaring the math functions.
- `test_math.c`: Contains test cases to verify the functionality of the math functions.
- `.github/workflows/ci.yml`: GitHub Actions workflow configuration for continuous integration (CI).## FUNCTIONS
```c
int add(int a, int b);
int subtract(int a, int b);
int multiply(int a, int b);
double divide(int a, int b);
```## TEST LOCALLY
To compile and run the tests locally, you need to have GCC installed.
1. Clone the repository:
```sh
git clone https://github.com/yourusername/math-functions.git
cd math-functions
```2. Compile the code:
```sh
gcc -o test_math math.c test_math.c
```3. Run the tests:
```sh
./test_math
```If all tests pass, you will see the message:
```
All tests passed
```## CI WORKFLOW STEPS
1. **Checkout Code**: Checks out the repository code.
2. **Install Dependencies**: Installs GCC.
3. **Compile**: Compiles the `math.c` and `test_math.c` files.
4. **Run Tests**: Runs the compiled test executable.The tests are run automatically on every push and pull request to the repository. Other events that trigger workflows are available [here](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
## CONTRIBUTING
If you find any issues or have suggestions for improvements, feel free to fork the repository and open an issue or submit a pull request.
## LICENSE
This project is available under the MIT License. For further details, please refer to the [LICENSE](https://github.com/jotavare/github-actions-overview/blob/main/LICENSE) file.