parent
d1faf2b3e4
commit
540099f2b7
@ -0,0 +1,47 @@ |
|||||||
|
name: mindmodel validation |
||||||
|
|
||||||
|
on: |
||||||
|
push: |
||||||
|
branches: [ main ] |
||||||
|
pull_request: |
||||||
|
branches: [ main ] |
||||||
|
|
||||||
|
jobs: |
||||||
|
validate: |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- name: Checkout |
||||||
|
uses: actions/checkout@v4 |
||||||
|
|
||||||
|
- name: Set up Python |
||||||
|
uses: actions/setup-python@v4 |
||||||
|
with: |
||||||
|
python-version: '3.x' |
||||||
|
|
||||||
|
- name: Install development dependencies (if present) |
||||||
|
run: | |
||||||
|
python -m pip install --upgrade pip |
||||||
|
if [ -f requirements-dev.txt ]; then |
||||||
|
pip install -r requirements-dev.txt |
||||||
|
else |
||||||
|
echo "requirements-dev.txt not found, skipping" |
||||||
|
fi |
||||||
|
|
||||||
|
- name: Run mindmodel validator (report-only) |
||||||
|
if: ${{ always() }} |
||||||
|
run: | |
||||||
|
# Make this step report-only: run the validator but always exit 0 so PRs are not blocked |
||||||
|
set +e |
||||||
|
if [ -f .mindmodel/manifest.yaml ]; then |
||||||
|
python scripts/validate_mindmodel.py --manifest .mindmodel/manifest.yaml --report reports/out.json || true |
||||||
|
else |
||||||
|
echo "No .mindmodel/manifest.yaml present — skipping validator" |
||||||
|
fi |
||||||
|
exit 0 |
||||||
|
|
||||||
|
- name: Upload mindmodel reports |
||||||
|
if: ${{ always() }} |
||||||
|
uses: actions/upload-artifact@v4 |
||||||
|
with: |
||||||
|
name: mindmodel-reports |
||||||
|
path: reports/mindmodel-report-*.json |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
import os |
||||||
|
|
||||||
|
try: |
||||||
|
import yaml |
||||||
|
|
||||||
|
_HAS_YAML = True |
||||||
|
except Exception: |
||||||
|
_HAS_YAML = False |
||||||
|
|
||||||
|
|
||||||
|
def test_mindmodel_workflow_exists_and_parses(): |
||||||
|
path = os.path.join(".github", "workflows", "mindmodel-validation.yml") |
||||||
|
assert os.path.exists(path), f"Workflow file {path} does not exist" |
||||||
|
|
||||||
|
# Minimal parse: if PyYAML is available, try safe_load; otherwise do a token check |
||||||
|
with open(path, "r", encoding="utf-8") as f: |
||||||
|
content = f.read() |
||||||
|
|
||||||
|
if _HAS_YAML: |
||||||
|
data = yaml.safe_load(content) |
||||||
|
assert data is not None and isinstance(data, dict) |
||||||
|
assert "on" in data or "name" in data |
||||||
|
else: |
||||||
|
# fall back to simple checks to avoid introducing new deps |
||||||
|
assert "name:" in content |
||||||
|
assert "on:" in content |
||||||
Loading…
Reference in new issue