Loading video player...
๐ฅ 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