Skip to content

Commit 94ba00f

Browse files
authored
Enhance Windows Daemon Debug Workflow with Logging
1 parent fd106ba commit 94ba00f

1 file changed

Lines changed: 103 additions & 1 deletion

File tree

.github/workflows/windows_daemon_debug.yml

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,106 @@ jobs:
3737
from pathlib import Path
3838
3939
# Windows-specific config path
40-
config_dir = Path(os.environ['USER
40+
config_dir = Path(os.environ['USERPROFILE']) / '.config' / 'omnipkg'
41+
config_dir.mkdir(parents=True, exist_ok=True)
42+
43+
config = {
44+
"interactive": False,
45+
"auto_confirm": True,
46+
"daemon_port": 5678,
47+
"log_level": "DEBUG" # Force debug logging for better scan results
48+
}
49+
50+
config_path = config_dir / 'config.json'
51+
with open(config_path, 'w') as f:
52+
json.dump(config, f, indent=2)
53+
print(f"✅ Config created at: {config_path}")
54+
55+
- name: 🚀 Start Omnipkg Daemon
56+
id: start_daemon
57+
shell: powershell
58+
run: |
59+
Write-Host "--- Starting Omnipkg Daemon ---"
60+
omnipkg daemon start
61+
62+
# Give it a moment to initialize or crash
63+
Start-Sleep -Seconds 5
64+
65+
- name: 🔍 Verify Daemon Status
66+
id: check_status
67+
shell: powershell
68+
run: |
69+
Write-Host "--- Checking Daemon Status ---"
70+
omnipkg daemon status
71+
72+
if ($LASTEXITCODE -ne 0) {
73+
Write-Error "❌ Daemon is not running!"
74+
exit 1
75+
}
76+
Write-Host "✅ Daemon is running successfully."
77+
78+
# ════════════════════════════════════════════════════════════════
79+
# 🕵️ LOG SCANNING SECTION (Runs only if previous steps failed)
80+
# ════════════════════════════════════════════════════════════════
81+
- name: 🩺 Scan and Dump Omnipkg Logs
82+
if: failure() || cancelled()
83+
shell: powershell
84+
run: |
85+
Write-Host "::group::🔍 LOCATING OMNIPKG LOGS"
86+
87+
# Define common log locations on Windows
88+
$userProfile = $env:USERPROFILE
89+
$locations = @(
90+
"$userProfile\.omnipkg\logs",
91+
"$userProfile\.config\omnipkg\logs",
92+
"$userProfile\AppData\Local\omnipkg\logs"
93+
)
94+
95+
$logFiles = @()
96+
97+
# Attempt to find logs in known locations
98+
foreach ($loc in $locations) {
99+
if (Test-Path $loc) {
100+
Write-Host "Found log directory: $loc"
101+
$files = Get-ChildItem -Path $loc -Filter "*.log" -Recurse
102+
$logFiles += $files
103+
}
104+
}
105+
106+
# Fallback: Search user profile if nothing found (slower but thorough)
107+
if ($logFiles.Count -eq 0) {
108+
Write-Host "⚠️ No logs in standard paths. Searching UserProfile (this may take a moment)..."
109+
$logFiles = Get-ChildItem -Path $userProfile -Filter "omnipkg*.log" -Recurse -ErrorAction SilentlyContinue
110+
}
111+
112+
Write-Host "::endgroup::"
113+
114+
if ($logFiles.Count -eq 0) {
115+
Write-Host "❌ NO LOG FILES FOUND."
116+
exit 0
117+
}
118+
119+
# Loop through found logs and print them
120+
foreach ($file in $logFiles) {
121+
Write-Host "══════════════════════════════════════════════════════"
122+
Write-Host "📄 LOG FILE: $($file.FullName)"
123+
Write-Host "🕒 Last Write: $($file.LastWriteTime)"
124+
Write-Host "══════════════════════════════════════════════════════"
125+
126+
Get-Content $file.FullName
127+
128+
Write-Host ""
129+
Write-Host ""
130+
}
131+
132+
- name: 📤 Upload Logs as Artifact
133+
if: always()
134+
uses: actions/upload-artifact@v4
135+
with:
136+
name: windows-omnipkg-logs
137+
path: |
138+
~/.omnipkg/logs/*.log
139+
~/.config/omnipkg/logs/*.log
140+
~/AppData/Local/omnipkg/logs/*.log
141+
if-no-files-found: warn
142+
retention-days: 5

0 commit comments

Comments
 (0)