45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
name: Validate Data Repo
|
|
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Validate JSON files
|
|
run: |
|
|
python - <<'PY'
|
|
import json
|
|
from pathlib import Path
|
|
|
|
json_files = list(Path(".").rglob("*.json"))
|
|
bad = []
|
|
for path in json_files:
|
|
try:
|
|
json.loads(path.read_text(encoding="utf-8"))
|
|
except Exception as exc:
|
|
bad.append(f"{path}: {exc}")
|
|
|
|
if bad:
|
|
raise SystemExit("Invalid JSON files:\n" + "\n".join(bad))
|
|
|
|
print(f"Validated {len(json_files)} JSON files.")
|
|
PY
|
|
|
|
- name: Check required top-level folders
|
|
run: |
|
|
test -d projects
|
|
test -d manifests
|