Skip to content

chore: liga o devTools do Vaadin em dev para auto-reload do frontend #35

chore: liga o devTools do Vaadin em dev para auto-reload do frontend

chore: liga o devTools do Vaadin em dev para auto-reload do frontend #35

name: Setup Script Validate
on:
pull_request:
branches: [main, staging, develop]
paths: &watched-paths
- "setup/**"
- "docker/**"
- "build.gradle.kts"
- "settings.gradle.kts"
- "gradle/**"
- "gradlew"
- "src/**"
- ".github/workflows/setup-script-validate.yml"
push:
branches: [main, staging, develop]
paths: *watched-paths
jobs:
setup:
strategy:
fail-fast: false
matrix:
include:
# Fixed runner versions, not ubuntu-latest/macos-latest — those tags move to a
# newer image over time without notice, which would silently invalidate the
# Apple Silicon-specific assumptions this workflow validates (TARGETARCH=arm64
# in docker/Dockerfile)
#
# macOS is install-only: GitHub-hosted macos-* runners have no nested
# virtualization, so no Docker daemon can run there — confirmed empirically
# (see ADR 0016). On macOS, Docker is a manual prerequisite, so setup.sh no
# longer installs it; the job provides just the docker CLI (below) so the
# requirements check passes and the remaining Homebrew installers
# (kubectl/minikube/helm/openssl) get validated. Full cluster provisioning is
# validated on Linux; real macOS users (outside this runner) are unaffected.
- os: ubuntu-24.04
timeout: 25
install_only: false
- os: macos-14
timeout: 15
install_only: true
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout }}
env:
# Skip setup.sh's interactive prompts — Minimal profile (1 node) keeps the
# cluster small enough to fit comfortably on standard GitHub-hosted runners.
AUTO_INSTALL: "y"
PROFILE_CHOICE: "1"
INSTALL_ONLY: ${{ matrix.install_only }}
# Force the local build path: setup.sh now defaults to pulling the published
# image, but this workflow exists to validate that docker/Dockerfile and the
# source still build. On PRs (pre-release) no image is published yet anyway.
BUILD_LOCAL: "true"
steps:
- uses: actions/checkout@v6
- name: Provide Docker CLI (macOS)
if: matrix.install_only == true
# macOS runners ship no Docker and setup.sh no longer installs it (Docker is a
# manual prerequisite on macOS). The install-only run stops before any daemon
# is needed, so the CLI binary alone satisfies the requirements check.
run: brew install docker
- name: Run setup.sh
run: ./setup/setup.sh
- name: Check GreenCap is reachable
if: matrix.install_only == false
run: |
# Retry — ingress-nginx reconciles the Ingress asynchronously after
# `kubectl apply`, so the route can 503 for a few seconds right after
# setup.sh reports the Deployment ready
for i in 1 2 3 4 5 6 7 8 9 10; do
if curl --fail -sS -L http://greencap.local; then
exit 0
fi
echo "Attempt $i failed, retrying in 5s..."
sleep 5
done
exit 1
- name: Dump diagnostics on failure
if: failure() && matrix.install_only == false
run: |
echo "── kubectl get pods -A ──"
kubectl get pods -A || true
echo "── kubectl describe non-Running pods ──"
# Explicit empty check instead of `xargs -r` — that flag is GNU-only and
# unsupported by BSD xargs on macOS
PENDING_PODS="$(kubectl get pods -A --field-selector=status.phase!=Running -o name 2>/dev/null || true)"
if [ -n "$PENDING_PODS" ]; then
echo "$PENDING_PODS" | xargs -n1 kubectl describe || true
fi
echo "── minikube logs ──"
minikube logs -p greencap-platform || true
- name: Teardown
if: always() && matrix.install_only == false
env:
CONFIRM: "yes"
run: ./setup/teardown.sh