Add JSON schema validation #6467
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
concurrency: | |
group: lint-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
json: | |
name: JSON validation (${{ matrix.entry.type }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
entry: | |
- type: appdaemon | |
- type: blacklist | |
- type: critical | |
schema: tools/jsonschema/critical.schema.json | |
- type: integration | |
- type: netdaemon | |
- type: plugin | |
- type: python_script | |
- type: removed | |
schema: tools/jsonschema/removed.schema.json | |
- type: template | |
- type: theme | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
- name: Validate with JQ | |
run: jq --raw-output . ${{ matrix.entry.type }} | |
- name: Validate with JSON schema | |
uses: cardinalby/[email protected] | |
with: | |
file: "${{ matrix.entry.type }}" | |
schema: "${{ matrix.entry.schema || 'tools/jsonschema/repositories.schema.json' }}" | |
sorted: | |
name: Sorted | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
- name: Check lists | |
run: python3 scripts/is_sorted.py |