Merge pull request #119 from xevrion/fix/responsive #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push,pull_request] | |
| jobs: | |
| CI_HEALTH_CHECK: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: inquizzitive | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| env: | |
| DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/inquizzitive" | |
| VITE_SUPABASE_URL: "http://localhost:54321" | |
| VITE_SUPABASE_ANON_KEY: "dummy" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: . | |
| - name: Wait for Postgres | |
| run: | | |
| for i in {1..10}; do | |
| if pg_isready -h localhost -U postgres; then | |
| echo "Postgres is ready" | |
| break | |
| fi | |
| echo "Waiting for Postgres..." | |
| sleep 2 | |
| done | |
| - name: Setup database schema | |
| run: psql $DATABASE_URL -f database-setup.sql | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Run Server | |
| run: | | |
| npm run dev > server.log 2>&1 & | |
| server_pid=$! | |
| echo "Server started with PID: $server_pid" | |
| for i in {1..15}; do | |
| if curl -fs http://localhost:5173 > /dev/null; then | |
| echo "Server is up!" | |
| pkill -f "node" | |
| exit 0 | |
| fi | |
| echo "Waiting for server... (attempt $i/15)" | |
| sleep 2 | |
| done | |
| echo "Server failed to start. Printing logs:" | |
| cat server.log | |
| pkill -f "node" | |
| exit 1 | |