Skip to content

Commit 9a3febc

Browse files
authored
Add GitHub Actions workflow for Flask Auto-Healing Demo
This workflow automates the Flask Auto-Healing Demo across Linux, macOS, and Windows environments. It includes setup steps for Python, omnipkg installation, and running a demo that showcases auto-healing capabilities.
1 parent 6f3f9c8 commit 9a3febc

1 file changed

Lines changed: 254 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
name: "🌠 Flask Auto-Healing Demo (Option 9)"
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
- main
8+
pull_request:
9+
branches:
10+
- development
11+
- main
12+
workflow_dispatch:
13+
inputs:
14+
branch:
15+
description: 'The branch to test'
16+
required: true
17+
default: 'development'
18+
type: choice
19+
options:
20+
- development
21+
- main
22+
- staging
23+
24+
jobs:
25+
flask-demo-linux:
26+
runs-on: ubuntu-latest
27+
name: "Flask Demo - Linux"
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
ref: ${{ github.event.inputs.branch || github.ref }}
34+
35+
- name: Set up Python 3.11
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.11'
39+
40+
- name: Clean previous omnipkg config
41+
run: |
42+
if [ -d ~/.config/omnipkg ]; then
43+
rm -rf ~/.config/omnipkg
44+
echo "✅ Cleared previous omnipkg config"
45+
else
46+
echo "ℹ️ No previous config found"
47+
fi
48+
49+
- name: Install omnipkg
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install -e .
53+
echo "✅ Omnipkg installed"
54+
55+
- name: Initialize omnipkg (trigger first-time setup)
56+
run: |
57+
echo "🔧 Running initial setup..."
58+
omnipkg status || echo "Initial setup completed with warnings (expected)"
59+
env:
60+
PYTHONUTF8: "1"
61+
62+
- name: Run Flask Auto-Healing Demo (Option 9)
63+
run: |
64+
echo "🎪 Running Flask Port Finder Demo with Auto-Healing"
65+
echo "=================================================="
66+
echo ""
67+
echo "This demo showcases:"
68+
echo " 1. UV attempts to run Flask test (will fail - Flask not installed)"
69+
echo " 2. omnipkg detects the failure and auto-heals by installing Flask"
70+
echo " 3. omnipkg re-runs the test successfully"
71+
echo " 4. Performance comparison: omnipkg vs UV"
72+
echo ""
73+
echo "Running: echo '9' | omnipkg demo"
74+
echo ""
75+
76+
# Run demo option 9 via stdin
77+
echo "9" | omnipkg demo
78+
79+
exitCode=$?
80+
echo ""
81+
echo "=================================================="
82+
echo "Exit code: $exitCode"
83+
84+
if [ $exitCode -eq 0 ]; then
85+
echo "✅ Flask Auto-Healing Demo completed successfully!"
86+
echo ""
87+
echo "Key achievements:"
88+
echo " ✓ UV failed as expected (Flask not installed)"
89+
echo " ✓ omnipkg auto-healed by installing Flask"
90+
echo " ✓ All Flask tests passed after healing"
91+
echo " ✓ Performance comparison showed omnipkg advantage"
92+
else
93+
echo "❌ Demo failed with exit code: $exitCode"
94+
exit $exitCode
95+
fi
96+
env:
97+
PYTHONUTF8: "1"
98+
99+
flask-demo-macos:
100+
runs-on: macos-latest
101+
name: "Flask Demo - macOS"
102+
103+
steps:
104+
- name: Checkout repository
105+
uses: actions/checkout@v4
106+
with:
107+
ref: ${{ github.event.inputs.branch || github.ref }}
108+
109+
- name: Set up Python 3.11
110+
uses: actions/setup-python@v5
111+
with:
112+
python-version: '3.11'
113+
114+
- name: Clean previous omnipkg config
115+
run: |
116+
if [ -d ~/.config/omnipkg ]; then
117+
rm -rf ~/.config/omnipkg
118+
echo "✅ Cleared previous omnipkg config"
119+
else
120+
echo "ℹ️ No previous config found"
121+
fi
122+
123+
- name: Install omnipkg
124+
run: |
125+
python -m pip install --upgrade pip
126+
pip install -e .
127+
echo "✅ Omnipkg installed"
128+
129+
- name: Initialize omnipkg (trigger first-time setup)
130+
run: |
131+
echo "🔧 Running initial setup..."
132+
omnipkg status || echo "Initial setup completed with warnings (expected)"
133+
env:
134+
PYTHONUTF8: "1"
135+
136+
- name: Run Flask Auto-Healing Demo (Option 9)
137+
run: |
138+
echo "🎪 Running Flask Port Finder Demo with Auto-Healing"
139+
echo "=================================================="
140+
echo ""
141+
echo "This demo showcases:"
142+
echo " 1. UV attempts to run Flask test (will fail - Flask not installed)"
143+
echo " 2. omnipkg detects the failure and auto-heals by installing Flask"
144+
echo " 3. omnipkg re-runs the test successfully"
145+
echo " 4. Performance comparison: omnipkg vs UV"
146+
echo ""
147+
echo "Running: echo '9' | omnipkg demo"
148+
echo ""
149+
150+
# Run demo option 9 via stdin
151+
echo "9" | omnipkg demo
152+
153+
exitCode=$?
154+
echo ""
155+
echo "=================================================="
156+
echo "Exit code: $exitCode"
157+
158+
if [ $exitCode -eq 0 ]; then
159+
echo "✅ Flask Auto-Healing Demo completed successfully!"
160+
echo ""
161+
echo "Key achievements:"
162+
echo " ✓ UV failed as expected (Flask not installed)"
163+
echo " ✓ omnipkg auto-healed by installing Flask"
164+
echo " ✓ All Flask tests passed after healing"
165+
echo " ✓ Performance comparison showed omnipkg advantage"
166+
else
167+
echo "❌ Demo failed with exit code: $exitCode"
168+
exit $exitCode
169+
fi
170+
env:
171+
PYTHONUTF8: "1"
172+
173+
flask-demo-windows:
174+
runs-on: windows-latest
175+
name: "Flask Demo - Windows"
176+
177+
steps:
178+
- name: Checkout repository
179+
uses: actions/checkout@v4
180+
with:
181+
ref: ${{ github.event.inputs.branch || github.ref }}
182+
183+
- name: Set up Python 3.11
184+
uses: actions/setup-python@v5
185+
with:
186+
python-version: '3.11'
187+
188+
- name: Clean previous omnipkg config
189+
run: |
190+
if (Test-Path ~\.config\omnipkg) {
191+
Remove-Item ~\.config\omnipkg -Recurse -Force
192+
Write-Host "✅ Cleared previous omnipkg config"
193+
} else {
194+
Write-Host "ℹ️ No previous config found"
195+
}
196+
shell: pwsh
197+
198+
- name: Install omnipkg
199+
run: |
200+
python -m pip install --upgrade pip
201+
pip install -e .
202+
Write-Host "✅ Omnipkg installed"
203+
shell: pwsh
204+
205+
- name: Initialize omnipkg (trigger first-time setup)
206+
run: |
207+
Write-Host "🔧 Running initial setup..."
208+
try {
209+
omnipkg status | Out-Null
210+
} catch {
211+
Write-Host "Initial setup completed with warnings (expected)"
212+
}
213+
shell: pwsh
214+
env:
215+
PYTHONUTF8: "1"
216+
217+
- name: Run Flask Auto-Healing Demo (Option 9)
218+
run: |
219+
Write-Host "🎪 Running Flask Port Finder Demo with Auto-Healing"
220+
Write-Host "=================================================="
221+
Write-Host ""
222+
Write-Host "This demo showcases:"
223+
Write-Host " 1. UV attempts to run Flask test (will fail - Flask not installed)"
224+
Write-Host " 2. omnipkg detects the failure and auto-heals by installing Flask"
225+
Write-Host " 3. omnipkg re-runs the test successfully"
226+
Write-Host " 4. Performance comparison: omnipkg vs UV"
227+
Write-Host ""
228+
Write-Host "Running: echo '9' | omnipkg demo"
229+
Write-Host ""
230+
231+
# Run demo option 9 via stdin (PowerShell style)
232+
"9" | omnipkg demo
233+
234+
$exitCode = $LASTEXITCODE
235+
Write-Host ""
236+
Write-Host "=================================================="
237+
Write-Host "Exit code: $exitCode"
238+
239+
if ($exitCode -eq 0) {
240+
Write-Host "✅ Flask Auto-Healing Demo completed successfully!"
241+
Write-Host ""
242+
Write-Host "Key achievements:"
243+
Write-Host " ✓ UV failed as expected (Flask not installed)"
244+
Write-Host " ✓ omnipkg auto-healed by installing Flask"
245+
Write-Host " ✓ All Flask tests passed after healing"
246+
Write-Host " ✓ Performance comparison showed omnipkg advantage"
247+
exit 0
248+
} else {
249+
Write-Host "❌ Demo failed with exit code: $exitCode"
250+
exit $exitCode
251+
}
252+
shell: pwsh
253+
env:
254+
PYTHONUTF8: "1"

0 commit comments

Comments
 (0)