Loading video player...
Stop manually testing your apps! In this video, I show you how to set up a professional-grade automation workflow using GitHub Actions. We’ll take a standard Node.js project and transform it into a self-verifying system that catches errors before they ever reach your users. What you’ll learn: ✅ How to create a custom test script in Node.js. ✅ Setting up the .github/workflows directory. ✅ Writing a YAML automation script. ✅ Real-time debugging using the GitHub Actions tab. 💻 Code Used in This Video 1. The Test Script (test.js) const fs = require('fs'); console.log("🔍 Starting Tests..."); if (fs.existsSync('./index.html')) { console.log("✅ index.html found!"); } else { console.error("❌ index.html is missing!"); process.exit(1); } if (fs.existsSync('./server.js')) { console.log("✅ server.js found!"); } else { console.error("❌ server.js is missing!"); process.exit(1); } console.log("🚀 All tests passed successfully!"); 2. Update package.json Add this line inside your "scripts" block: "test": "node test.js" 3. The Automation Workflow (.github/workflows/main.yml) name: Project Verification on: [push] jobs: verify: runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 - name: Setup Node uses: actions/setup-node@v4 with: node-version: '20' - name: Install Dependencies run: npm install - name: Run Safety Tests run: npm test 🛠️ Useful Resources GitHub Actions Documentation Node.js Official Website Don't forget to LIKE and SUBSCRIBE if this helped you automate your workflow! 🚀 #GitHubActions #NodeJS #WebDevelopment #Automation #DevOps #ProgrammingTutorial #coding2025