From 6bf8bad5fb79a0982810e671789db4873d7287f1 Mon Sep 17 00:00:00 2001 From: RaymondVerhoef Date: Sun, 12 Jul 2026 20:55:35 +0200 Subject: [PATCH] ci: validate both Caddyfiles in the test job (#26) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test image swaps in Caddyfile.test, so the production Caddyfile was never exercised by CI: the parse error from issue #20 sailed through every check and only surfaced when the deploy gate failed — after the broken container had already replaced the healthy one. Running `caddy validate` (same caddy:2-alpine base as the Dockerfile) on both files up front fails the PR check in seconds instead. Touches the frozen .github/workflows/ per explicit product-owner approval in #26. Closes #26 Co-Authored-By: Claude Fable 5 --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c41f013..5fb2303 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,18 @@ jobs: - name: Checkout uses: actions/checkout@v4 + # The test image below swaps in Caddyfile.test, so the production + # Caddyfile is otherwise never exercised by CI — an invalid config then + # only surfaces when the deploy health-gate fails, after the broken + # container already replaced the healthy one (issue #20/#26). Validate + # both files up front so a parse error fails the PR check in seconds. + - name: Validate Caddyfiles + run: | + docker run --rm -v "$PWD":/workspace -w /workspace caddy:2-alpine \ + caddy validate --config Caddyfile --adapter caddyfile + docker run --rm -v "$PWD":/workspace -w /workspace caddy:2-alpine \ + caddy validate --config Caddyfile.test --adapter caddyfile + - name: Build Docker image run: docker build -t learning-platform .