0:00
40:17
40:17

GitHub Actions Tutorial 2026 ๐Ÿ”ฅ Episode 4: The CI Pipeline Most Developers Are Missing

Tech

๐Ÿ”ฅ Welcome to Episode 4 of the GitHub Actions Tutorial Series 2026! In this video, youโ€™ll learn how to build a SMART CI Pipeline for FastAPI that automatically tests, analyzes, and secures your code before deployment ๐Ÿš€ ๐Ÿ‘‰ Stop bad code BEFORE it reaches production! ๐Ÿ’ก What Youโ€™ll Learn in This Video: โœ… Run automated tests using pytest โœ… Measure code coverage with pytest-cov (80% threshold) โœ… Generate HTML & XML test reports โœ… Perform linting using flake8 (clean code practices) โœ… Run security scans using bandit ๐Ÿ” โœ… Detect vulnerable dependencies using pip-audit โš ๏ธ โœ… Build a centralized pipeline status system (status.json) โœ… Upload artifacts & create CI reports dashboard โš™๏ธ Tech Stack Covered: * FastAPI * GitHub Actions CI/CD * pytest + pytest-cov + pytest-html * flake8 + flake8-html * bandit (security scanning) * pip-audit (dependency vulnerabilities) * Docker-ready pipeline structure ๐Ÿš€ Why This CI Pipeline is Powerful: This is NOT a basic pipeline. It ensures: โœ” Code quality โœ” Security compliance โœ” Test coverage enforcement โœ” Early bug detection โœ” Production-ready standards ๐Ÿ“‚ GitHub Repository: (https://github.com/shubhamagrawal17/Tutorial/tree/main/GitHub%20Actions/Day-4/fastapi-app) ๐Ÿ“Œ Series Playlist: โ–ถ๏ธ Episode 1 โ€“ What is GitHub Actions? + First Workflow โ–ถ๏ธ Episode 2 โ€“ Build Your First CI Pipeline (Build, Test & Code Quality) โ–ถ๏ธ Episode 3 โ€“ Build Your First CD Pipeline (Deploy to Azure) โ–ถ๏ธ Episode 4โ†’ Smart CI Pipeline (This Video) 00:00 ๐Ÿ‘‹ Introduction โ€“ Episode 4 Overview (CI Pipeline + Docker โ†’ ACR) 00:22 ๐Ÿ“Š Dashboard Preview โ€“ Test Reports, Coverage, Lint, Security & Vulnerabilities 00:58 ๐ŸŒ GitHub Pages โ€“ Serving the Static Dashboard 01:34 ๐Ÿ“ Test Reports Overview โ€“ Pass/Fail, Code Coverage Breakdown 02:42 โš ๏ธ Lint Warnings Demo โ€“ Unused JWT Module Example 03:00 ๐Ÿ’ป pipeline.yml Walkthrough โ€“ File Structure Explained 03:42 โš™๏ธ Workflow Setup โ€“ Name, Triggers & Global Environment Variables 04:07 ๐Ÿƒ Test Job โ€“ Ubuntu Runner, Code Checkout, Python 3.11 + Caching 05:26 ๐Ÿ“ฆ Installing Dependencies โ€“ pip install, pytest, pytest-coverage, pytest-html 07:16 ๐Ÿงช Running pytest โ€“ JUnit XML Report + HTML Conversion + 80% Coverage Threshold 08:41 ๐Ÿ“ˆ Extracting Coverage % โ€“ Inline Python Script โ†’ status.json Artifact 10:30 ๐Ÿ”„ status.json Deep Dive โ€“ Shared Artifact Across Jobs 12:43 ๐Ÿงน Lint Stage โ€“ Flake8 Setup + Downloading Artifacts 14:21 ๐Ÿšซ Bypassing Flake8 Errors โ€“ double pipe true Explained 16:08 ๐Ÿ›ก๏ธ Security Stage โ€“ Bandit Scan + Hardcoded Credentials Warning 19:20 ๐Ÿ› Dependency Scan Stage โ€“ pip audit + Vulnerability Detection 21:16 ๐Ÿš€ Deploy Reports Stage โ€“ Collecting Reports โ†’ site Folder โ†’ GitHub Pages 23:44 ๐ŸŒ Enabling GitHub Pages โ€“ Repository Settings + gh-pages Branch 24:54 ๐Ÿš€ GitHub Pages Action โ€“ peaceiris/actions-gh-pages@v3 Setup 26:45 ๐Ÿณ Build & Push Stage โ€“ Docker Image โ†’ ACR with OIDC Authentication 27:36 โ˜๏ธ Azure Setup โ€“ ACR + App Registration + Federated Credentials + ACR Push Role 31:16 ๐Ÿ”‘ GitHub Secrets โ€“ ACR Name, Client ID & Tenant ID 33:49 ๐Ÿš€ Triggering the Workflow โ€“ Live Run (Test + Lint Jobs) 35:36 ๐Ÿ“Š Pipeline Success โ€“ Reports Deployed + Docker Image Pushed to ACR 36:56 ๐Ÿ”„ Dashboard Refresh โ€“ Confirming Updated Reports (Timestamp Verified) 37:26 ๐Ÿž Django Vulnerability Highlighted โ€“ Intentional Demo in requirements.txt 37:58 โŒ Removing double pipe true โ€“ Forcing a Real Lint Failure 39:38 ๐Ÿ›‘ Lint Job Fails โ€“ Pipeline Correctly Catches Errors 40:00 ๐Ÿ‘‹ Outro โ€“ Next Episode: Deploy to Azure Kubernetes Services (AKS) #githubactions #devops #fastapi #cicd #python #automation #softwareengineering #testing #security #docker #cloudops #azure #gitops #git #code #clouds

ADVERTISEMENT
Comments 2 wandamyst1: How can I do this in AWS?