Fix CI DinD networking: host network mode + curl timeout
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 2m43s
CI/CD / test-sqlite (pull_request) Successful in 2m49s
CI/CD / test-runners (pull_request) Failing after 38s
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 2m43s
CI/CD / test-sqlite (pull_request) Successful in 2m49s
CI/CD / test-runners (pull_request) Failing after 38s
CI/CD / build-and-deploy (pull_request) Has been skipped
The previous fix (container IP resolution) still failed because the CI runner and compose containers are on separate Docker networks. - Add docker-compose.ci.yml override with network_mode: host so the container shares the runner's network stack directly - Add --connect-timeout 2 to curl in wait-for-healthy.sh so it fails fast instead of hanging indefinitely on unreachable hosts - Cap health check at 30s (server boots in 5-10s) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -385,42 +385,32 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker compose build
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build
|
||||
|
||||
- name: Boot server (SQLite)
|
||||
- name: Boot server (SQLite, host networking)
|
||||
env:
|
||||
BUNDLED_PACKAGES: '*'
|
||||
ARMATURE_ADMIN_USERNAME: admin
|
||||
ARMATURE_ADMIN_PASSWORD: admin
|
||||
ARMATURE_ADMIN_EMAIL: admin@test.local
|
||||
run: docker compose up -d
|
||||
|
||||
# In DinD (Gitea runner pods), port-mapped localhost doesn't reach
|
||||
# the compose container. Resolve the container IP on its Docker
|
||||
# network so curl / Playwright can connect directly on port 80.
|
||||
- name: Resolve container IP
|
||||
id: container-ip
|
||||
run: |
|
||||
IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' armature)
|
||||
echo "SERVER_URL=http://${IP}:80" >> "$GITHUB_OUTPUT"
|
||||
echo "Resolved container IP → ${IP}"
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d
|
||||
|
||||
- name: Wait for healthy
|
||||
run: ./ci/wait-for-healthy.sh ${{ steps.container-ip.outputs.SERVER_URL }}
|
||||
run: ./ci/wait-for-healthy.sh http://localhost:80 30
|
||||
|
||||
- name: Install Playwright
|
||||
run: npx playwright install --with-deps chromium
|
||||
|
||||
- name: Run surface tests
|
||||
env:
|
||||
SERVER_URL: ${{ steps.container-ip.outputs.SERVER_URL }}
|
||||
SERVER_URL: http://localhost:80
|
||||
ADMIN_USER: admin
|
||||
ADMIN_PASS: admin
|
||||
run: ./ci/run-surface-tests.sh
|
||||
|
||||
- name: Teardown
|
||||
if: always()
|
||||
run: docker compose down -v
|
||||
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml down -v
|
||||
|
||||
# ── Stage 2: Build, Database, Deploy ─────────
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user