Skip to content

This repository contains a simple Python application that demonstrates a basic CI/CD pipeline using GitHub Actions. The project includes basic mathematical operations, unit tests for these operations, and a workflow that automates the testing process.

Notifications You must be signed in to change notification settings

Rohan-Thoma/Testing-Github-Actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Application with GitHub Actions CI

This repository contains a simple Python application that demonstrates a basic CI/CD pipeline using GitHub Actions. The project includes basic mathematical operations, unit tests for these operations, and a workflow that automates the testing process.


πŸ“œ About the Project

This project is set up to showcase a straightforward Python application with an integrated continuous integration (CI) workflow. When code is pushed to the master branch or a pull request is created against master, the GitHub Actions workflow is automatically triggered.

The core of this project is a simple Python module that performs two basic mathematical operations:

  • Addition
  • Subtraction

✨ Features

  • Basic Python Application: Includes a src directory with the main application logic. The application currently supports addition and subtraction.
  • Unit Tests: The tests directory contains unit tests written using the pytest framework to ensure the reliability of the mathematical operations.
  • Automated CI Pipeline: A GitHub Actions workflow (.github/workflows/python-app.yml) is configured to automatically:
    1. Check out the code from the repository.
    2. Set up a Python 3.10 environment.
    3. Install the required dependencies from the requirements.txt file.
    4. Run the pytest suite to validate the code.
  • Dependency Management: Project dependencies are managed in the requirements.txt file, which includes pandas and pytest.

πŸš€ Getting Started

Prerequisites

  • Python 3.10 or later
  • pip for installing packages

Installation

  1. Clone the repository:
    git clone https://github.com/rohan-thoma/testing_github_actions.git
    cd testing_github_actions
  2. Install the dependencies:
    pip install -r requirements.txt

πŸ§ͺ Running the Tests

To run the tests locally, navigate to the root directory of the project and execute the following command:

pytest

The tests will verify the correctness of the add and sub functions in the src.math_operations module.


πŸ€– Continuous Integration

This project uses GitHub Actions for its CI pipeline. The workflow is defined in the .github/workflows/python-app.yml file and is triggered on every push and pull_request to the master branch.

The CI pipeline performs the following steps:

  1. Checkout Code: The first step checks out the repository's code.
  2. Set up Python: It sets up the Python 3.10 environment.
  3. Install Dependencies: It installs all the necessary dependencies from the requirements.txt file.
  4. Run Tests: Finally, it runs the test suite using pytest to ensure that the changes have not introduced any regressions.

About

This repository contains a simple Python application that demonstrates a basic CI/CD pipeline using GitHub Actions. The project includes basic mathematical operations, unit tests for these operations, and a workflow that automates the testing process.

Topics

Resources

Stars

Watchers

Forks

Languages