From 5a364e75f2398f38c9f9bed95950d8744ccb6430 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Thu, 2 Apr 2026 09:52:33 +0000 Subject: [PATCH] Fix test-runner volume mount for DinD workspace In Gitea runner pods, the repo checkout lives in a Docker volume, not a host path. The `.:/work` mount in docker-compose.ci.yml resolved to the Docker daemon's CWD (empty), causing "No such file or directory". Resolve the actual Docker volume backing the CI workspace at runtime and pass it via CI_WORKSPACE_VOLUME env var. Falls back to `.` for local (non-DinD) usage. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/ci.yaml | 20 ++++++++++++++++++++ docker-compose.ci.yml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index eeceeaf..63a3b55 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -384,12 +384,32 @@ jobs: - name: Checkout uses: actions/checkout@v4 + # In DinD (Gitea runners), the workspace is a Docker volume, not a + # host path. Resolve the volume backing $PWD so the test-runner + # container can mount the same checkout. + - name: Resolve workspace volume + id: ws + run: | + # The CI runner's own container has the workspace mounted. + # Find which Docker volume backs the current working directory. + SELF=$(cat /proc/1/cpuset 2>/dev/null | sed 's|.*/||' || hostname) + VOL=$(docker inspect "$SELF" 2>/dev/null \ + | grep -oP '"Source":\s*"\K[^"]+' \ + | head -1) || true + if [ -z "$VOL" ]; then + # Fallback: current directory (works for non-DinD environments) + VOL="." + fi + echo "CI_WORKSPACE_VOLUME=${VOL}" >> "$GITHUB_OUTPUT" + echo "Workspace volume → ${VOL}" + - name: Run surface tests (compose) env: BUNDLED_PACKAGES: '*' ARMATURE_ADMIN_USERNAME: admin ARMATURE_ADMIN_PASSWORD: admin ARMATURE_ADMIN_EMAIL: admin@test.local + CI_WORKSPACE_VOLUME: ${{ steps.ws.outputs.CI_WORKSPACE_VOLUME }} run: | docker compose -f docker-compose.yml -f docker-compose.ci.yml up --build \ --abort-on-container-exit \ diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index 81bf0ef..5f1ea0d 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -31,7 +31,7 @@ services: condition: service_healthy working_dir: /work volumes: - - .:/work + - ${CI_WORKSPACE_VOLUME:-.}:/work environment: SERVER_URL: http://armature:80 ADMIN_USER: admin