diff --git a/.github/workflows/scenario-schema.yml b/.github/workflows/scenario-schema.yml new file mode 100644 index 000000000..008e32863 --- /dev/null +++ b/.github/workflows/scenario-schema.yml @@ -0,0 +1,28 @@ +name: Validate scenarios against schema +on: + push: + paths: + - 'data/scenarios/**.yaml' + branches: + - main + pull_request: + paths: + - 'data/scenarios/**.yaml' + branches: + - main +jobs: + validate-scenario-schema: + name: Validate scenarios schema + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install check-jsonschema + - run: | + find data/scenarios -name "*.yaml" -type f -print0 | xargs -0 check-jsonschema --base-uri $(git rev-parse --show-toplevel)/data/schema/scenario.json --schemafile data/schema/scenario.json