Build CI scripts into test-runner image instead of volume mount
Some checks failed
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 6s
CI/CD / test-go-pg (pull_request) Successful in 2m50s
CI/CD / test-sqlite (pull_request) Successful in 2m55s
CI/CD / test-runners (pull_request) Failing after 59s
CI/CD / build-and-deploy (pull_request) Has been skipped
Some checks failed
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 6s
CI/CD / test-go-pg (pull_request) Successful in 2m50s
CI/CD / test-sqlite (pull_request) Successful in 2m55s
CI/CD / test-runners (pull_request) Failing after 59s
CI/CD / build-and-deploy (pull_request) Has been skipped
DinD volume mounts don't work — the Docker daemon can't see the CI runner's workspace volume. Instead, COPY ci/ into the Playwright image at build time via dockerfile_inline. No volume detection needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -384,32 +384,12 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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)
|
- name: Run surface tests (compose)
|
||||||
env:
|
env:
|
||||||
BUNDLED_PACKAGES: '*'
|
BUNDLED_PACKAGES: '*'
|
||||||
ARMATURE_ADMIN_USERNAME: admin
|
ARMATURE_ADMIN_USERNAME: admin
|
||||||
ARMATURE_ADMIN_PASSWORD: admin
|
ARMATURE_ADMIN_PASSWORD: admin
|
||||||
ARMATURE_ADMIN_EMAIL: admin@test.local
|
ARMATURE_ADMIN_EMAIL: admin@test.local
|
||||||
CI_WORKSPACE_VOLUME: ${{ steps.ws.outputs.CI_WORKSPACE_VOLUME }}
|
|
||||||
run: |
|
run: |
|
||||||
docker compose -f docker-compose.yml -f docker-compose.ci.yml up --build \
|
docker compose -f docker-compose.yml -f docker-compose.ci.yml up --build \
|
||||||
--abort-on-container-exit \
|
--abort-on-container-exit \
|
||||||
|
|||||||
@@ -25,20 +25,20 @@ services:
|
|||||||
start_period: 5s
|
start_period: 5s
|
||||||
|
|
||||||
test-runner:
|
test-runner:
|
||||||
image: mcr.microsoft.com/playwright:v1.52.0-noble
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile_inline: |
|
||||||
|
FROM mcr.microsoft.com/playwright:v1.52.0-noble
|
||||||
|
RUN npm install --no-save playwright 2>/dev/null
|
||||||
|
WORKDIR /work
|
||||||
|
COPY ci/ /work/ci/
|
||||||
|
RUN chmod +x /work/ci/*.sh
|
||||||
depends_on:
|
depends_on:
|
||||||
armature:
|
armature:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
working_dir: /work
|
working_dir: /work
|
||||||
volumes:
|
|
||||||
- ${CI_WORKSPACE_VOLUME:-.}:/work
|
|
||||||
environment:
|
environment:
|
||||||
SERVER_URL: http://armature:80
|
SERVER_URL: http://armature:80
|
||||||
ADMIN_USER: admin
|
ADMIN_USER: admin
|
||||||
ADMIN_PASS: admin
|
ADMIN_PASS: admin
|
||||||
command:
|
command: ["bash", "-c", "./ci/run-surface-tests.sh"]
|
||||||
- bash
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
npm install --no-save playwright 2>/dev/null
|
|
||||||
./ci/run-surface-tests.sh
|
|
||||||
|
|||||||
Reference in New Issue
Block a user