mirror of
https://git.turbo-data.com/nprasad2077/docker-templates.git
synced 2026-09-22 16:15:53 +00:00
flows fix
This commit is contained in:
+36
-44
@@ -11,58 +11,50 @@ on:
|
||||
jobs:
|
||||
healthcheck:
|
||||
runs-on: ubuntu-latest
|
||||
name: Code, dbt & Live App Health Check
|
||||
name: Compose Templates Health Check
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y curl unzip git ca-certificates
|
||||
apt-get update && apt-get install -y python3 python3-yaml git ca-certificates
|
||||
|
||||
- name: Install uv
|
||||
- name: Validate Compose Templates & Workflows
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
echo "/root/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install Project Dependencies
|
||||
run: |
|
||||
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
|
||||
uv sync
|
||||
|
||||
- name: Python Syntax & Compilation Verification
|
||||
run: |
|
||||
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
|
||||
echo "==> Validating Python scripts compilation..."
|
||||
uv run python -m py_compile streamlit_app/app.py scripts/db_storage.py
|
||||
echo "✓ Python scripts compiled without errors"
|
||||
|
||||
- name: dbt Manifest & Model Validation
|
||||
run: |
|
||||
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
|
||||
echo "==> Validating dbt package dependencies..."
|
||||
uv run dbt deps --project-dir dbt_nba --profiles-dir dbt_nba
|
||||
echo "==> Validating dbt models, seeds, and tests compilation..."
|
||||
uv run dbt parse --project-dir dbt_nba --profiles-dir dbt_nba
|
||||
echo "✓ All dbt models, seeds, and macros validated"
|
||||
|
||||
- name: Cloudflare R2 Storage Probe (Optional if secrets present)
|
||||
env:
|
||||
S3_ENDPOINT_URL: ${{ secrets.S3_ENDPOINT_URL }}
|
||||
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
|
||||
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
|
||||
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
|
||||
S3_REGION: ${{ secrets.S3_REGION || 'auto' }}
|
||||
S3_DB_KEY: ${{ secrets.S3_DB_KEY || 'dbt_nba.duckdb' }}
|
||||
run: |
|
||||
export PATH="$HOME/.local/bin:/root/.local/bin:$PATH"
|
||||
if [ -n "${S3_ENDPOINT_URL:-}" ]; then
|
||||
echo "==> Probing Cloudflare R2 storage status..."
|
||||
uv run python scripts/db_storage.py status
|
||||
else
|
||||
echo "==> S3 secrets not configured for this step; skipping storage probe."
|
||||
fi
|
||||
echo "==> Validating all docker-compose.yml files..."
|
||||
python3 - <<'PY'
|
||||
import pathlib, sys
|
||||
try:
|
||||
import yaml
|
||||
except ImportError:
|
||||
print("pyyaml missing"); sys.exit(1)
|
||||
failures = []
|
||||
files = sorted(pathlib.Path(".").glob("*/docker-compose.yml"))
|
||||
assert files, "no */docker-compose.yml found"
|
||||
for f in files:
|
||||
try:
|
||||
doc = yaml.safe_load(f.read_text())
|
||||
except Exception as e:
|
||||
failures.append(f"{f}: YAML parse error: {e}")
|
||||
continue
|
||||
if not isinstance(doc, dict) or "services" not in doc:
|
||||
failures.append(f"{f}: missing top-level 'services' key")
|
||||
continue
|
||||
for svc, cfg in doc["services"].items():
|
||||
if not isinstance(cfg, dict) or "image" not in cfg:
|
||||
failures.append(f"{f}: service '{svc}' missing 'image'")
|
||||
print(f"OK {f} services={list(doc['services'].keys())}")
|
||||
for f in sorted(pathlib.Path(".gitea/workflows").glob("*.y*ml")):
|
||||
try:
|
||||
yaml.safe_load(f.read_text())
|
||||
print(f"OK {f}")
|
||||
except Exception as e:
|
||||
failures.append(f"{f}: YAML parse error: {e}")
|
||||
if failures:
|
||||
print("FAILURES:"); [print(" -", x) for x in failures]; sys.exit(1)
|
||||
print("All templates validated")
|
||||
PY
|
||||
|
||||
- name: Live Production App Health Probe
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user