Skip to content

Add sourceos.event.v0.1 JSON Schema #21

Add sourceos.event.v0.1 JSON Schema

Add sourceos.event.v0.1 JSON Schema #21

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install package and test tools
run: |
python -m pip install --upgrade pip
python -m pip install -e . pytest
- name: Parse schema files
run: |
python - <<'PY'
import json
from pathlib import Path
for path in sorted(Path('schemas').glob('*.schema.json')):
data = json.loads(path.read_text())
assert data['$schema'] == 'https://json-schema.org/draft/2020-12/schema'
assert data['title']
print(f'validated {path}')
PY
- name: Run tests
run: pytest -q
- name: Exercise CLI snapshot
run: sourceos-syncd health snapshot --compact > /tmp/sourceos-syncd.snapshot.json
- name: Exercise CLI explain
run: sourceos-syncd health explain --file examples/health/healthy.snapshot.json --compact
- name: Exercise CLI verify healthy example
run: sourceos-syncd health verify --file examples/health/healthy.snapshot.json --compact
- name: Exercise CLI verify degraded example
run: sourceos-syncd health verify --file examples/health/degraded.snapshot.json --compact || test $? -eq 2
- name: Exercise repair plan preview
run: sourceos-syncd repair plan --file examples/health/degraded.snapshot.json --compact > /tmp/sourceos-syncd.repair-plan.json