This is a Python application designed to demonstrate Continuous Integration (CI) automation using GitHub Actions.
The objective of this project is to understand how to set up and automate CI processes using GitHub Actions.
- Open VS Code: Launch Visual Studio Code to begin working on your project.
- Open Project Folder: Navigate to the folder where your project will reside.
- Activate Your Environment: Set up and activate your Python virtual environment (e.g.,
python -m venv venv
andsource venv/bin/activate
orvenv\Scripts\activate
on Windows). - Create a
requirements.txt
File: List the dependencies required for your project in arequirements.txt
file. Then, install them usingpip install -r requirements.txt
. - Create a
README.md
File: Write some basic information about your project, including the title and objective. - Initialize a Git Repository: Run
git init
to create a new Git repository. - Set Up the GitHub Repository: Follow the instructions in GitHub after creating a new repository to connect it to your local project in VS Code.
- Create a
src
Directory:- Add a Python file (e.g.,
math_operations.py
) in thesrc
folder where you define your app functions. - Also, add an
__init__.py
file inside thesrc
folder to make the functions callable from other files.
- Add a Python file (e.g.,
- Create a
tests
Directory:- Name of directory should be
tests
because this is requirement of pytest to find this folder and run test functions. - Add a Python test file in the
tests
folder (e.g.,test_math_operations.py
) where you will writepytest
functions to test the functions inmath_operations.py
. - Add an
__init__.py
file inside thetests
folder.
- Name of directory should be
- Set Up GitHub Actions:
- Create a directory for GitHub Actions workflows:
.github/workflows/
. - Inside it, create a YAML file (e.g.,
python-app.yml
) to define the CI pipeline for your app. - To understand how to write this YAML file, check out this video, which explains the YAML file's content and how to run it.
- Create a directory for GitHub Actions workflows:
- Push Your Changes:
- After creating the YAML file and pushing your commits to GitHub, the CI process will start automatically.
- You can monitor the progress in the Actions tab on GitHub.