name: Test on: [push] jobs: unit-test: runs-on: test steps: - uses: actions/checkout@v4 - name: Install & Run unit tests run: cd frontend && npm ci && npx vitest run --reporter=verbose e2e-test: runs-on: test needs: unit-test steps: - uses: actions/checkout@v4 - name: Install deps run: | cd frontend && npm ci python3 -m venv /tmp/ci-venv && /tmp/ci-venv/bin/pip install -q -r backend/requirements.txt - name: E2E tests run: | # Start backend + frontend in background, run cypress, then cleanup DB_PATH=/tmp/ci_oil_test.db FRONTEND_DIR=/dev/null \ /tmp/ci-venv/bin/uvicorn backend.main:app --port 8000 & BACKEND_PID=$! cd frontend && npx vite --port 5173 & FRONTEND_PID=$! # Wait for servers for i in $(seq 1 30); do if curl -sf http://localhost:8000/api/version > /dev/null 2>&1 && \ curl -sf http://localhost:5173/ > /dev/null 2>&1; then echo "Both servers ready" break fi sleep 1 done # Run cypress SPECS=$(ls cypress/e2e/*.cy.js | grep -v demo | grep -v visual | grep -v check | tr '\n' ',') npx cypress run --spec "$SPECS" --config video=false || true # Cleanup kill $BACKEND_PID $FRONTEND_PID 2>/dev/null || true rm -f /tmp/ci_oil_test.db build-check: runs-on: test steps: - uses: actions/checkout@v4 - name: Build frontend run: cd frontend && npm ci && npm run build