From 540354ff9e45fec48a46e8e2a87ef639b3e35f55 Mon Sep 17 00:00:00 2001 From: Joe Freeman Date: Sat, 25 Jul 2026 18:40:37 -0700 Subject: [PATCH 1/2] Add GitHub Actions for compose validation and opt-in smoke testing Fast-pass workflow runs docker compose config on every example on push/PR to catch construction errors without pulling images or starting containers. A second, heavier workflow actually brings each stack up and tears it down, but is workflow_dispatch-only so it never runs automatically. --- .github/workflows/compose-smoke-test.yml | 47 ++++++++++++++++++++++++ .github/workflows/compose-validate.yml | 40 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/compose-smoke-test.yml create mode 100644 .github/workflows/compose-validate.yml diff --git a/.github/workflows/compose-smoke-test.yml b/.github/workflows/compose-smoke-test.yml new file mode 100644 index 0000000..4b8241c --- /dev/null +++ b/.github/workflows/compose-smoke-test.yml @@ -0,0 +1,47 @@ +name: Compose Smoke Test + +# Longer activity: actually brings each example's stack up and confirms +# every service reaches "running"/healthy state, then tears it down. +# Manual trigger only (workflow_dispatch) - not wired to push/pull_request, +# since standard runners may be undersized for the heavier examples +# (datastax, kafka-confluent) and image pulls make this slow. + +on: + workflow_dispatch: + +jobs: + discover: + runs-on: ubuntu-latest + outputs: + examples: ${{ steps.find.outputs.examples }} + steps: + - uses: actions/checkout@v4 + - id: find + run: | + examples=$(find . -maxdepth 2 -name docker-compose.yml -printf '%h\n' \ + | sed 's|^\./||' | sort | jq -R -s -c 'split("\n")[:-1]') + echo "examples=$examples" >> "$GITHUB_OUTPUT" + + smoke-test: + needs: discover + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + example: ${{ fromJson(needs.discover.outputs.examples) }} + steps: + - uses: actions/checkout@v4 + - name: Seed .env from template if present + run: | + if [ -f "${{ matrix.example }}/.env.template" ]; then + cp "${{ matrix.example }}/.env.template" "${{ matrix.example }}/.env" + fi + - name: Start stack and wait for services to be healthy/running + run: docker compose -f "${{ matrix.example }}/docker-compose.yml" up -d --wait --wait-timeout 120 + - name: Show container status + if: always() + run: docker compose -f "${{ matrix.example }}/docker-compose.yml" ps -a + - name: Tear down + if: always() + run: docker compose -f "${{ matrix.example }}/docker-compose.yml" down -v diff --git a/.github/workflows/compose-validate.yml b/.github/workflows/compose-validate.yml new file mode 100644 index 0000000..adad31a --- /dev/null +++ b/.github/workflows/compose-validate.yml @@ -0,0 +1,40 @@ +name: Compose Validate + +# Fast pass: confirms every example's docker-compose.yml parses and +# resolves (services, networks, volumes, env interpolation) without +# pulling images or starting any containers. + +on: + push: + branches: [main] + pull_request: + +jobs: + discover: + runs-on: ubuntu-latest + outputs: + examples: ${{ steps.find.outputs.examples }} + steps: + - uses: actions/checkout@v4 + - id: find + run: | + examples=$(find . -maxdepth 2 -name docker-compose.yml -printf '%h\n' \ + | sed 's|^\./||' | sort | jq -R -s -c 'split("\n")[:-1]') + echo "examples=$examples" >> "$GITHUB_OUTPUT" + + validate: + needs: discover + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + example: ${{ fromJson(needs.discover.outputs.examples) }} + steps: + - uses: actions/checkout@v4 + - name: Seed .env from template if present + run: | + if [ -f "${{ matrix.example }}/.env.template" ]; then + cp "${{ matrix.example }}/.env.template" "${{ matrix.example }}/.env" + fi + - name: Validate compose construction + run: docker compose -f "${{ matrix.example }}/docker-compose.yml" config --quiet From 815c64a5464f76bc6051d807c9e9910245b7f28f Mon Sep 17 00:00:00 2001 From: Joe Freeman Date: Sat, 25 Jul 2026 18:43:28 -0700 Subject: [PATCH 2/2] Bump actions/checkout to v5 to clear Node 20 deprecation warning actions/checkout@v4 targets Node 20, which GitHub is deprecating on hosted runners and now runs under a forced Node 24 shim with a warning. v5 targets Node 24 natively. --- .github/workflows/compose-smoke-test.yml | 4 ++-- .github/workflows/compose-validate.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compose-smoke-test.yml b/.github/workflows/compose-smoke-test.yml index 4b8241c..94c9eda 100644 --- a/.github/workflows/compose-smoke-test.yml +++ b/.github/workflows/compose-smoke-test.yml @@ -15,7 +15,7 @@ jobs: outputs: examples: ${{ steps.find.outputs.examples }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - id: find run: | examples=$(find . -maxdepth 2 -name docker-compose.yml -printf '%h\n' \ @@ -31,7 +31,7 @@ jobs: matrix: example: ${{ fromJson(needs.discover.outputs.examples) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Seed .env from template if present run: | if [ -f "${{ matrix.example }}/.env.template" ]; then diff --git a/.github/workflows/compose-validate.yml b/.github/workflows/compose-validate.yml index adad31a..fa814a1 100644 --- a/.github/workflows/compose-validate.yml +++ b/.github/workflows/compose-validate.yml @@ -15,7 +15,7 @@ jobs: outputs: examples: ${{ steps.find.outputs.examples }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - id: find run: | examples=$(find . -maxdepth 2 -name docker-compose.yml -printf '%h\n' \ @@ -30,7 +30,7 @@ jobs: matrix: example: ${{ fromJson(needs.discover.outputs.examples) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Seed .env from template if present run: | if [ -f "${{ matrix.example }}/.env.template" ]; then