-
Notifications
You must be signed in to change notification settings - Fork 14
43 lines (38 loc) · 1.17 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
41
42
43
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
strategy:
matrix:
python-version: ["3.8", "3.12"]
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} env
uses: ./.github/actions/setup-python-env
with:
python-version: ${{ matrix.python-version }}
- name: Generate JSON Schema
run: make json_schema
- 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