@@ -24,19 +24,19 @@ jobs:
2424 python -m venv venv
2525 source venv/bin/activate
2626 pip install --upgrade pip
27- pip install flask requests sqlite3 python-dotenv pytest
28- pip install -r requirements.txt # if exists
27+ pip install flask requests python-dotenv pytest
28+ pip install -r requirements.txt
2929
3030 - name : 🧪 Create test database
3131 run : |
32- python -c "
32+ python -c '
3333import sqlite3
34- conn = sqlite3.connect(' sites.db' )
35- conn.execute(' CREATE TABLE IF NOT EXISTS sites (id INTEGER PRIMARY KEY, url TEXT, check_interval INTEGER, expected_text TEXT, enabled INTEGER)' )
36- conn.execute(' CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY, site_id INTEGER, status INTEGER, response_time REAL, timestamp TEXT)' )
34+ conn = sqlite3.connect(" sites.db" )
35+ conn.execute(" CREATE TABLE IF NOT EXISTS sites (id INTEGER PRIMARY KEY, url TEXT, check_interval INTEGER, expected_text TEXT, enabled INTEGER)" )
36+ conn.execute(" CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY, site_id INTEGER, status INTEGER, response_time REAL, timestamp TEXT)" )
3737conn.commit()
3838conn.close()
39- "
39+ '
4040
4141 - name: 📁 Create dummy templates for tests
4242 run: |
@@ -55,25 +55,13 @@ conn.close()
5555 - name : 🔨 Run app in background & test API
5656 run : |
5757 source venv/bin/activate
58-
59- # Start app.py in the background
6058 python app.py &
6159 APP_PID=$!
62-
63- # Wait for startup
6460 sleep 10
65-
66- # Test homepage
6761 curl -f http://localhost:5000 || (echo '❌ / failed' && exit 1)
6862 curl -f http://localhost:5000/?lang=en || (echo '❌ /?lang=en failed' && exit 1)
69-
70- # Test admin page
7163 curl -f http://localhost:5000/admin || (echo '❌ /admin failed' && exit 1)
72-
73- # Test SSE stream
7464 timeout 15s curl -f http://localhost:5000/stream | head -n 2 || true
75-
76- # Stop the server
7765 kill $APP_PID || true
7866 sleep 2
7967
0 commit comments