Add test workflow using options field for healthcheck #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Healthcheck DSL - Service Containers | ||
|
Check failure on line 1 in .github/workflows/test-healthcheck.yml
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - feature/service-container-healthcheck | ||
| jobs: | ||
| test-healthcheck: | ||
| runs-on: self-hosted | ||
| services: | ||
| minio: | ||
| image: quay.io/minio/minio:latest | ||
| healthcheck-cmd: "curl -f http://localhost:9000/minio/health/live || exit 1" | ||
| healthcheck-interval: 30s | ||
| healthcheck-timeout: 10s | ||
| healthcheck-retries: 5 | ||
| env: | ||
| MINIO_ROOT_USER: minioadmin | ||
| MINIO_ROOT_PASSWORD: minioadmin | ||
| ports: | ||
| - 9000:9000 | ||
| - 9001:9001 | ||
| volumes: | ||
| - minio-data:/data | ||
| command: server /data --console-address ":9001" | ||
| redis: | ||
| image: redis:7-alpine | ||
| healthcheck-cmd: "redis-cli ping" | ||
| healthcheck-interval: 5s | ||
| healthcheck-timeout: 3s | ||
| healthcheck-retries: 3 | ||
| ports: | ||
| - 6379:6379 | ||
| steps: | ||
| - name: Verify healthcheck configuration | ||
| run: | | ||
| echo "Checking Minio healthcheck..." | ||
| curl -f http://localhost:9000/minio/health/live || exit 1 | ||
| echo "✅ Minio healthcheck passed" | ||
| echo "Checking Redis healthcheck..." | ||
| redis-cli -h localhost ping | ||
| echo "✅ Redis healthcheck passed" | ||
| - name: Inspect container healthcheck config | ||
| run: | | ||
| echo "Container health configurations:" | ||
| echo "" | ||
| echo "Minio container:" | ||
| docker inspect --format='Healthcheck: {{.Config.Healthcheck}}' $(docker ps -q -f "name=minio") || true | ||
| echo "" | ||
| echo "Redis container:" | ||
| docker inspect --format='Healthcheck: {{.Config.Healthcheck}}' $(docker ps -q -f "name=redis") || true | ||
| volumes: | ||
| minio-data: | ||