-
Notifications
You must be signed in to change notification settings - Fork 14
40 lines (35 loc) · 1.12 KB
/
ci-schema-consistency.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: JSON Schema Consistency Check
on:
workflow_dispatch:
pull_request:
# run these jobs when a PR is opened, reopened, or updated (synchronize)
# synchronize = commit(s) pushed to the pull request
types:
- opened
- reopened
- synchronize
paths:
- "dbt_semantic_interfaces/**"
jobs:
json-schema-consistency-check:
name: Schema Consistency Check
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: ./.github/actions/setup-python-env
with:
python-version: "3.9"
- name: Generate JSON Schema
run: hatch run dev-env:python dbt_semantic_interfaces/parsing/generate_json_schema_file.py
- name: Schema Consistency Check
run: |
if [[ $(git diff) ]]
then
git diff
echo 'Failure: JSON schema and generated schema do not match. Run make json_schema and commit the updated schema changes before merge.'
exit 1
else
echo 'Success: JSON schema and generated schema match.'
fi