diff --git a/.github/workflows/mindmodel-schedule.yml b/.github/workflows/mindmodel-schedule.yml new file mode 100644 index 0000000..e9ea5f3 --- /dev/null +++ b/.github/workflows/mindmodel-schedule.yml @@ -0,0 +1,35 @@ +name: mindmodel scheduled validate + +on: + schedule: + - cron: '0 0 * * 0' # weekly + +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.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt || true + + - name: Run tests + run: | + python -m pytest -q + + - name: Run mindmodel validator if manifest exists + if: ${{ always() }} + run: | + if [ -f .mindmodel/manifest.yaml ]; then + python -m scripts.mindmodel.cli || true + else + echo "No .mindmodel/manifest.yaml present — skipping validator" + fi diff --git a/tests/ci/test_schedule_exists.py b/tests/ci/test_schedule_exists.py new file mode 100644 index 0000000..122e038 --- /dev/null +++ b/tests/ci/test_schedule_exists.py @@ -0,0 +1,11 @@ +import pathlib + + +def test_schedule_workflow_exists(): + path = pathlib.Path(".github/workflows/mindmodel-schedule.yml") + assert path.exists(), f"Expected {path} to exist" + + text = path.read_text(encoding="utf-8") + # ensure the file is a GitHub Actions workflow that declares a schedule + assert "on:" in text + assert "schedule" in text