{"id":29427539,"url":"https://github.com/yashpandey1405/github-actions-cicd-testing","last_synced_at":"2026-04-18T11:32:47.942Z","repository":{"id":303953549,"uuid":"1017267077","full_name":"YashPandey1405/github-actions-cicd-testing","owner":"YashPandey1405","description":"A mini-project demonstrating CI/CD pipeline setup using GitHub Actions for a Node.js Express API, with automated testing via Jest and Supertest","archived":false,"fork":false,"pushed_at":"2025-07-10T09:39:57.000Z","size":205,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T17:46:28.715Z","etag":null,"topics":["cicd-pipeline","github-actions","testing"],"latest_commit_sha":null,"homepage":"http://bit.ly/4nFwVch","language":"JavaScript","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/YashPandey1405.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,"zenodo":null}},"created_at":"2025-07-10T09:19:38.000Z","updated_at":"2025-07-10T09:40:01.000Z","dependencies_parsed_at":"2025-07-10T18:07:01.329Z","dependency_job_id":null,"html_url":"https://github.com/YashPandey1405/github-actions-cicd-testing","commit_stats":null,"previous_names":["yashpandey1405/github-actions-cicd-testing"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/YashPandey1405/github-actions-cicd-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YashPandey1405%2Fgithub-actions-cicd-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YashPandey1405%2Fgithub-actions-cicd-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YashPandey1405%2Fgithub-actions-cicd-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YashPandey1405%2Fgithub-actions-cicd-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YashPandey1405","download_url":"https://codeload.github.com/YashPandey1405/github-actions-cicd-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YashPandey1405%2Fgithub-actions-cicd-testing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264995813,"owners_count":23695047,"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-pipeline","github-actions","testing"],"created_at":"2025-07-12T13:09:22.193Z","updated_at":"2025-10-05T15:31:58.710Z","avatar_url":"https://github.com/YashPandey1405.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚙️ CI/CD Pipeline with GitHub Actions \u0026 API Testing\n\nA mini-project demonstrating **CI/CD pipeline implementation using GitHub Actions** and **automated API route testing** with **Jest** and **Supertest** for a Node.js Express application.\n\n---\n\n## 📌 What is CI/CD?\n\n**CI/CD** stands for:\n\n- **Continuous Integration (CI)** – Automatically test and build your app whenever you push code to the repository.\n- **Continuous Deployment (CD)** – Automatically deploy the app when the tests pass, ensuring your latest code is always live.\n\nThese pipelines:\n\n- Detect code changes (`git push`)\n- Run test suites\n- Deploy only on success\n- Eliminate manual errors \u0026 reduce dev-ops overhead\n\n---\n\n## ⚙️ What are GitHub Actions?\n\n**GitHub Actions** is an automation tool provided by GitHub. You can define custom workflows in `.yml` files to:\n\n- Run tests\n- Build and deploy code\n- Trigger jobs based on events like commits or pull requests\n\nThis project uses a GitHub Action to:\n\n1. Install dependencies\n2. Run tests\n3. Deploy via a Render deploy hook (only if all tests pass ✅)\n\n---\n\n## 🧪 What is Unit Testing using Jest \u0026 Supertest?\n\n### **Jest**:\n\nA JavaScript testing framework by Facebook for writing unit tests. It supports:\n\n- Assertions (`expect(...)`)\n- Mocks and spies\n- Test runners\n\n### **Supertest**:\n\nA high-level abstraction to test HTTP endpoints. It simulates requests and checks responses without needing to deploy the server externally.\n\n### 🔍 Example:\n\n```js\nit(\"GET / returns Hello World\", async () =\u003e {\n  const res = await request(app).get(\"/\");\n  expect(res.statusCode).toBe(200);\n  expect(res.text).toBe(\"Hello World\");\n});\n```\n\n---\n\n## 🚀 Project Overview\n\nThis mini-project includes:\n\n- A simple Express server with two routes:\n\n  - `/` → Returns `Hello World`\n  - `/:id` → Returns `Hello World \u003cid\u003e`\n\n- Test cases for both routes using **Jest** and **Supertest**\n- A GitHub Actions workflow to automatically:\n\n  - Install dependencies\n  - Run tests\n  - Deploy to Render (if tests pass)\n\n---\n\n## ✅ Correct Test Results\n\nWhen the routes are implemented correctly, **all test cases pass** successfully:\n\n![Correct Tests](./asserts/Correct-Test-Results.png)\n\n---\n\n## ❌ Failed Test Results\n\nIf any route is broken or missing, **relevant test cases fail**, ensuring reliability:\n\n## ![Wrong Tests](./asserts/Wrong-Test-Results.png)\n\n---\n\n## ✅ Automated Testing via GitHub Actions\n\nEvery code push triggers **automated testing on GitHub Actions**.\nIf any route fails, the pipeline halts — ensuring only **fully tested, reliable code** gets deployed.\n\n![GitHub Actions](./asserts/GitHub-Actions.png)\n\n---\n\n## 📁 Tech Stack\n\n- **Node.js / Express**\n- **Jest** for testing logic\n- **Supertest** for endpoint testing\n- **GitHub Actions** for CI/CD automation\n- **Render** for deployment (via deploy hook)\n\n---\n\n## 🧠 Learning Outcomes\n\n✅ Understand CI/CD and GitHub Actions\n✅ Build \u0026 test Express routes\n✅ Automate testing and deployment pipeline\n✅ Visualize real test outcomes (pass vs fail)\n\n---\n\n## 🧑‍🎓 Author\n\n**Made with 💻, ☕ and GitHub Actions** by [Yash Pandey](https://github.com/YashPandey-dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashpandey1405%2Fgithub-actions-cicd-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashpandey1405%2Fgithub-actions-cicd-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashpandey1405%2Fgithub-actions-cicd-testing/lists"}