diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb0108e..a2ab820 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,6 @@ name: SyncForge CI on: push: - branches: - - main pull_request: branches: - main @@ -52,8 +50,8 @@ jobs: - name: Build frontend run: npm run build - docker-build: - name: Docker Build + docker-smoke-test: + name: Docker Build and Smoke Test runs-on: ubuntu-latest needs: - backend-tests @@ -68,3 +66,37 @@ jobs: - name: Build Docker images run: docker compose build + + - name: Start Docker Compose stack + run: docker compose up -d + + - name: Wait for backend health + run: | + for i in {1..30}; do + if curl -fsS http://localhost:8080/actuator/health; then + echo "Backend is healthy" + exit 0 + fi + + echo "Waiting for backend..." + sleep 5 + done + + echo "Backend did not become healthy" + docker compose logs syncforge-api + exit 1 + + - name: Check frontend response + run: curl -fsS http://localhost:3000 > /dev/null + + - name: Show running containers + if: always() + run: docker compose ps + + - name: Show logs on failure + if: failure() + run: docker compose logs + + - name: Stop Docker Compose stack + if: always() + run: docker compose down -v diff --git a/docker-compose.yml b/docker-compose.yml index 14842c1..61fae85 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,6 +44,10 @@ services: restart: unless-stopped ports: - "8080:8080" + environment: + SYNCFORGE_SECURITY_JWT_SECRET: "ci-local-dev-secret-key-12345678901234567890" + SYNCFORGE_SECURITY_JWT_ACCESS_TOKEN_MINUTES: "15" + SYNCFORGE_SECURITY_REFRESH_TOKEN_DAYS: "7" depends_on: mysql: condition: service_healthy