#!/bin/bash echo "๐Ÿงช Testing kNotes Workflow Setup..." echo "" # Check if we're in the right directory if [ ! -f ".github/workflows/buildAndRelease.yml" ]; then echo "โŒ Error: Not in the correct repository root" exit 1 fi echo "๐Ÿ“‹ Checking workflow files..." echo "โœ… Main workflow: .github/workflows/buildAndRelease.yml" echo "โœ… Test workflow: .github/workflows/test-workflow.yml" echo "" echo "๐Ÿ“ฆ Checking desktop app configuration..." if [ -f "desktop-app/package.json" ]; then VERSION=$(node -p "require('./desktop-app/package.json').version" 2>/dev/null) if [ $? -eq 0 ]; then echo "โœ… Desktop app version: $VERSION" else echo "โŒ Could not read desktop app version" fi else echo "โŒ desktop-app/package.json not found" fi echo "" echo "๐Ÿ—๏ธ Checking build files..." if [ -f "build.gradle" ]; then echo "โœ… Gradle build file found" else echo "โŒ build.gradle not found" fi if [ -f "Dockerfile" ]; then echo "โœ… Dockerfile found" else echo "โŒ Dockerfile not found" fi echo "" echo "๐Ÿ“ Checking frontend files..." if [ -d "src/main/resources/static" ]; then echo "โœ… Frontend directory found" FILE_COUNT=$(find src/main/resources/static -type f | wc -l) echo "โœ… Frontend files: $FILE_COUNT files" else echo "โŒ Frontend directory not found" fi echo "" echo "๐Ÿ”ง Checking Node.js/npm (for desktop builds)..." if command -v node &> /dev/null; then NODE_VERSION=$(node --version) echo "โœ… Node.js: $NODE_VERSION" else echo "โš ๏ธ Node.js not found (needed for desktop builds)" fi if command -v npm &> /dev/null; then NPM_VERSION=$(npm --version) echo "โœ… npm: $NPM_VERSION" else echo "โš ๏ธ npm not found (needed for desktop builds)" fi echo "" echo "๐Ÿณ Checking Docker (optional)..." if command -v docker &> /dev/null; then DOCKER_VERSION=$(docker --version) echo "โœ… Docker: $DOCKER_VERSION" else echo "โ„น๏ธ Docker not found (GitHub Actions will handle this)" fi echo "" echo "๐Ÿ“‹ Workflow Test Summary:" echo "โœ… Repository structure is correct" echo "โœ… All required configuration files present" echo "โœ… Workflow files are properly configured" echo "" echo "๐Ÿš€ How to test:" echo "" echo "1. ๐Ÿงช SAFE TEST (Dry run, no deployment):" echo " - Push this code to GitHub" echo " - Go to: GitHub โ†’ Actions โ†’ 'Test Workflow (Dry Run)'" echo " - Click 'Run workflow' โ†’ Choose test level โ†’ Run" echo "" echo "2. ๐Ÿงช MANUAL TRIGGER (Real workflow, will deploy):" echo " - Go to: GitHub โ†’ Actions โ†’ 'Release'" echo " - Click 'Run workflow' โ†’ Run" echo "" echo "3. ๐Ÿš€ FULL TEST (Real deployment):" echo " - Make any small change and push to main branch" echo " - Watch the workflow run automatically" echo "" echo "โš ๏ธ IMPORTANT:" echo " - Test workflow (option 1) is SAFE - no deployments" echo " - Manual trigger (option 2) WILL deploy Docker + create releases" echo " - Full test (option 3) WILL deploy everything" echo "" echo "โœจ Workflow test complete!"