TESTING_WORKFLOW.md 3.9 KB

🧪 How to Test Your GitHub Workflow

Your unified workflow is ready! Here are 3 safe ways to test it before going live:

All Tests Pass Locally!

# Run the local validation script:
./test-workflow.sh

Results:

  • ✅ Repository structure is correct
  • ✅ All required configuration files present
  • ✅ Workflow files are properly configured
  • ✅ Desktop app version: 1.1.0
  • ✅ 11 frontend files ready for desktop app
  • ✅ Node.js, npm, and Docker all available

🧪 Option 1: SAFE DRY RUN (Recommended First Test)

What it does:

  • Tests workflow logic without deploying anything
  • Validates all steps on all platforms (Linux, Windows, macOS)
  • No Docker push - completely safe
  • No GitHub releases created

How to run:

  1. Push your code to GitHub (if not already pushed)
  2. Go to GitHub → Your repository → Actions
  3. Click "Test Workflow (Dry Run)" on the left
  4. Click "Run workflow" button
  5. Choose test level:
    • basic - Fast validation (5 minutes)
    • full - Complete validation (15 minutes)
  6. Click "Run workflow"

Expected output:

✅ Java Build Test: PASSED
✅ Docker Build Test: PASSED
✅ Release Creation Test: PASSED
✅ Linux Desktop Test: PASSED
✅ Windows Desktop Test: PASSED
✅ macOS Desktop Test: PASSED

🚀 Your unified workflow is ready!

🧪 Option 2: MANUAL TRIGGER (Real Workflow)

What it does:

  • ⚠️ WILL actually deploy Docker image
  • ⚠️ WILL create GitHub release with desktop apps
  • ⚠️ WILL update https://notes.lhamacorp.com

How to run:

  1. Go to GitHub → Your repository → Actions
  2. Click "Release" on the left
  3. Click "Run workflow" button
  4. Click "Run workflow"

Use when:

  • Dry run test passed ✅
  • You're ready to deploy
  • You want to test the full flow manually

🚀 Option 3: AUTOMATIC TRIGGER (Production)

What it does:

  • ⚠️ WILL deploy everything automatically
  • ⚠️ WILL update production on every push to main

How it works:

# Any change triggers deployment:
echo "// Test change" >> src/main/resources/static/css/style.css
git add .
git commit -m "Test workflow"
git push origin main

# → GitHub Actions automatically:
# 1. Builds and tests Java app
# 2. Deploys Docker to production
# 3. Creates GitHub release
# 4. Builds desktop apps for all platforms

Use when:

  • Manual trigger test passed ✅
  • You're confident in the workflow
  • Ready for automatic deployments

📊 Test Results Dashboard

After running tests, you can monitor progress at:

  • GitHubActions tab
  • Real-time logs for each job
  • Build artifacts and results

Typical timing:

  • Dry run: ~5-15 minutes
  • Manual trigger: ~10-20 minutes
  • Automatic: ~10-20 minutes

🔧 Troubleshooting

If workflow fails:

  1. Check the logs in GitHub Actions
  2. Common issues:
    • Missing secrets (DOCKERHUB_USERNAME, DOCKERHUB_TOKEN)
    • GitHub token permissionsFIXED: Added explicit permissions
    • Node.js version conflicts

If desktop builds fail:

  1. Check npm install step in logs
  2. Verify electron-builder configuration
  3. Try local build first: npm run build-linux

🎯 Recommended Testing Order

  1. ✅ Local validation - ./test-workflow.sh
  2. 🧪 Dry run test - GitHub Actions test workflow
  3. 🧪 Manual trigger - Real workflow when ready
  4. 🚀 Automatic - Push to main for production

💡 Pro Tips

  • Start with dry run to catch issues early
  • Test on a branch first if you want extra safety
  • Check GitHub releases page after successful runs
  • Desktop apps take longest - be patient (~10-15 mins)
  • Each platform builds in parallel for speed

Your workflow is production-ready! 🎉