{"id":19055751,"url":"https://github.com/fatimajamali81/github-actions-pytest","last_synced_at":"2026-05-16T18:02:10.820Z","repository":{"id":249647979,"uuid":"832107590","full_name":"fatimajamali81/github-actions-pytest","owner":"fatimajamali81","description":"CI/CD pipeline for a Python Application using GitHub Actions; It also includes steps to automatically run tests (using Pytest in the Python App) on every pull request.","archived":false,"fork":false,"pushed_at":"2024-07-23T12:38:09.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T11:27:08.263Z","etag":null,"topics":["cicd","github-actions","pipeline","pytest","python-application","workflows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fatimajamali81.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T11:18:54.000Z","updated_at":"2024-07-23T12:38:12.000Z","dependencies_parsed_at":"2024-07-22T13:32:52.518Z","dependency_job_id":"04868467-e497-42f1-bcc7-86230a7510ee","html_url":"https://github.com/fatimajamali81/github-actions-pytest","commit_stats":null,"previous_names":["fatimajamali81/github-actions-pytest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatimajamali81%2Fgithub-actions-pytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatimajamali81%2Fgithub-actions-pytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatimajamali81%2Fgithub-actions-pytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatimajamali81%2Fgithub-actions-pytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fatimajamali81","download_url":"https://codeload.github.com/fatimajamali81/github-actions-pytest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240111973,"owners_count":19749570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cicd","github-actions","pipeline","pytest","python-application","workflows"],"created_at":"2024-11-08T23:46:52.518Z","updated_at":"2026-05-11T14:30:21.275Z","avatar_url":"https://github.com/fatimajamali81.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python CI/CD with GitHub Actions and pytest\nThis repository contains a simple Python application integrated with a CI/CD pipeline using GitHub Actions. The pipeline automatically runs tests using `pytest` on every pull request to ensure code quality and correctness.\n\n\n## Description of Files\n\n`.github/workflows/ci.yml`: This file configures the GitHub Actions workflow. It sets up the CI/CD pipeline to run on every pull request to the main branch. The workflow includes steps to:\n\n1. Check out the repository code\n2. Set up Python (with versions 3.8, 3.9, and 3.10)\n3. Install dependencies from requirements.txt\n4. Run tests using pytest\n\n- `app/init.py`: Marks the app directory as a Python package.\n\n- `app/main.py`: Contains the main application code with basic arithmetic functions (add and subtract).\n\n- `tests/init.py` : Marks the tests directory as a Python package.\n\n- `tests/test_main.py` : Contains unit tests for the functions defined in app/main.py using pytest.\n\n- `requirements.txt` : Lists the project dependencies, including pytest for testing.\n\n- `README.md` : Provides an overview of the project, repository structure, and instructions for running the application and tests.\n\n## Getting Started\n\n### Prerequisites\nEnsure you have the following installed on your local machine:\n\n- **Python 3.8 or higher**\n- **pip (Python package installer)**\n- **Installation**\n- **Clone the repository**:\n\n```sh\ngit clone https://github.com/yourusername/github-actions-pytest.git\ncd github-actions-pytest\n```\n- **Install the dependencies**:\n```sh\npip install -r requirements.txt\n```\n### Running the Application\nYou can run the main application code directly. For example, to use the add and subtract functions:\n\n```sh\nfrom app.main import add, subtract\n\nprint(add(3, 5))    # Output: 8\nprint(subtract(10, 5))  # Output: 5\n```\n### Running Tests\nTo run the tests using pytest, execute the following command:\n\n```sh\npytest\n```\n\nThis will automatically discover and run all tests in the tests directory.\n\n## CI/CD Pipeline\n\nThe CI/CD pipeline is configured using GitHub Actions in the `.github/workflows/ci.yml` file. The pipeline runs on every pull request to the main branch and includes the following steps:\n\n- **Checkout**: Retrieves the latest code from the repository.\n- **Set up Python**: Sets up the specified versions of Python.\n- **Install dependencies**: Installs the required dependencies listed in requirements.txt.\n- **Run tests**: Executes the tests using pytest.\n- **Viewing CI/CD Results**: After creating a pull request, you can view the status of the CI/CD pipeline in the \"Actions\" tab of your GitHub repository. Detailed logs and results of the workflow runs will be available there.\n\n## License\nThis project is licensed under the MIT License.\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatimajamali81%2Fgithub-actions-pytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffatimajamali81%2Fgithub-actions-pytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatimajamali81%2Fgithub-actions-pytest/lists"}