diff --git a/.gitea/workflows/cicd-checks.yaml b/.gitea/workflows/cicd-checks.yaml index db4b3d5..cb33ab7 100644 --- a/.gitea/workflows/cicd-checks.yaml +++ b/.gitea/workflows/cicd-checks.yaml @@ -65,8 +65,8 @@ jobs: run-check: name: ${{ matrix.name }} - # Prefer the generic ubuntu-latest label for better runner availability. - runs-on: ubuntu-latest + # Docker-capable runner required: pulls and runs the CICD container image. + runs-on: ubuntu-act timeout-minutes: 20 needs: setup strategy: diff --git a/.gitea/workflows/cicd-tests.yaml b/.gitea/workflows/cicd-tests.yaml index f8c629d..d799f4b 100644 --- a/.gitea/workflows/cicd-tests.yaml +++ b/.gitea/workflows/cicd-tests.yaml @@ -65,8 +65,8 @@ jobs: backend-tests: name: Backend Tests - # Prefer the generic ubuntu-latest label for better runner availability. - runs-on: ubuntu-latest + # Docker-capable runner required: pulls and runs the CICD container image. + runs-on: ubuntu-act timeout-minutes: 25 needs: setup steps: @@ -119,8 +119,8 @@ jobs: frontend-tests: name: Frontend Tests - # Prefer the generic ubuntu-latest label for better runner availability. - runs-on: ubuntu-latest + # Docker-capable runner required: pulls and runs the CICD container image. + runs-on: ubuntu-act timeout-minutes: 25 needs: setup steps: @@ -137,8 +137,8 @@ jobs: xdoctest: name: Backend Doctests - # Prefer the generic ubuntu-latest label for better runner availability. - runs-on: ubuntu-latest + # Docker-capable runner required: pulls and runs the CICD container image. + runs-on: ubuntu-act timeout-minutes: 15 needs: setup steps: @@ -156,8 +156,8 @@ jobs: integration-tests: name: Integration Tests - # Prefer the generic ubuntu-latest label for better runner availability. - runs-on: ubuntu-latest + # Docker-capable runner required: pulls and runs the CICD container image. + runs-on: ubuntu-act timeout-minutes: 20 needs: [setup, backend-tests] steps: @@ -179,8 +179,8 @@ jobs: e2e-tests: name: End-to-End Tests - # Prefer the generic ubuntu-latest label for better runner availability. - runs-on: ubuntu-latest + # Docker-capable runner required: pulls and runs the CICD container image. + runs-on: ubuntu-act timeout-minutes: 30 needs: [setup, frontend-tests] steps: diff --git a/Dockerfile.cicd b/Dockerfile.cicd index 9e1b447..35c73d3 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -45,6 +45,7 @@ RUN --mount=type=secret,id=ssh_private_key \ cp /tmp/repo/backend/pyproject.toml /workspace/backend/ 2>/dev/null || echo "No backend pyproject.toml" && \ cp /tmp/repo/frontend/package.json /workspace/frontend/ 2>/dev/null || echo "No frontend package.json" && \ cp /tmp/repo/frontend/yarn.lock /workspace/frontend/ 2>/dev/null || echo "No frontend yarn.lock" && \ + cp /tmp/repo/frontend/.yarnrc.yml /workspace/frontend/ 2>/dev/null || echo "No frontend .yarnrc.yml" && \ cp /tmp/repo/.pre-commit-config.yaml /workspace/ 2>/dev/null || echo "No pre-commit config" && \ echo "✓ Dependency files extracted for optimized layer caching" && \ rm -rf ~/.ssh @@ -138,7 +139,7 @@ RUN echo "Copying source code while preserving installed dependencies..." && \ if [ "$basename_item" = "backend" ] && [ -d "/workspace/backend/.venv" ]; then \ echo "Copying backend files while preserving .venv..."; \ find "$item" -mindepth 1 -maxdepth 1 ! -name ".venv" -exec cp -rf {} /workspace/backend/ \;; \ - elif [ "$basename_item" = "frontend" ] && ([ -d "/workspace/frontend/node_modules" ] || [ -f "/workspace/frontend/.pnp.cjs" ]); then \ + elif [ "$basename_item" = "frontend" ] && [ -d "/workspace/frontend/node_modules" ]; then \ echo "Copying frontend files (will regenerate Yarn state after)..."; \ cp -rf "$item"/* /workspace/frontend/; \ else \ @@ -157,15 +158,15 @@ RUN echo "Copying source code while preserving installed dependencies..." && \ echo "✓ Full source code copied, dependencies preserved" && \ rm -rf /tmp/repo -# PHASE 3.5: Regenerate Yarn PnP state after source code update +# PHASE 3.5: Re-link Yarn after source code update (node-modules linker only) WORKDIR /workspace/frontend -RUN if [ -f "package.json" ] && [ -f ".pnp.cjs" ]; then \ - echo "=== Regenerating Yarn PnP State After Source Code Update ===" && \ - echo "Source package.json and installed dependencies may have differences..." && \ +RUN if [ -f "package.json" ] && [ -d "node_modules" ]; then \ + echo "=== Re-linking Yarn node_modules After Source Code Update ===" && \ + echo "Ensuring package.json and installed node_modules are in sync..." && \ yarn install --immutable && \ - echo "✓ Yarn PnP state regenerated successfully - tools should now work"; \ + echo "✓ Yarn node_modules re-linked successfully"; \ else \ - echo "ℹ No Yarn PnP setup detected, skipping state regeneration"; \ + echo "ℹ No node_modules detected, skipping Yarn re-link"; \ fi # PHASE 4: Install backend package in development mode (requires full source) @@ -233,7 +234,7 @@ RUN cd /workspace/frontend && \ if [ -f ".frontend-deps-failed" ]; then \ echo "WARNING: Skipping frontend tool verification due to failed dependencies installation"; \ echo "Frontend CI/CD jobs may be limited in this environment"; \ - elif [ -d "node_modules" ] || [ -f ".pnp.cjs" ]; then \ + elif [ -d "node_modules" ]; then \ verify_required_tool() { \ tool_name="$1"; \ yarn_target="$2"; \ @@ -257,18 +258,14 @@ RUN cd /workspace/frontend && \ echo "⚠ ${tool_name} version check failed under Yarn wrapper; continuing"; \ return 0; \ }; \ - if [ -f ".pnp.cjs" ]; then \ - echo "✓ Yarn PnP dependencies found (.pnp.cjs), verifying tools..."; \ - else \ - echo "✓ Traditional node_modules found, verifying tools..."; \ - fi && \ + echo "✓ node_modules dependencies found, verifying tools..." && \ verify_required_tool "eslint" "eslint" "eslint" && \ verify_required_tool "prettier" "prettier" "prettier" && \ verify_required_tool "typescript" "tsc" "tsc" && \ verify_optional_yarn_tool "vitest" "vitest" && \ echo "✓ All frontend tools verified successfully"; \ else \ - echo "ERROR: No frontend dependencies found (neither node_modules nor .pnp.cjs)"; \ + echo "ERROR: No frontend node_modules found"; \ echo "Available files in frontend:"; \ ls -la .; \ exit 1; \