1616 required : true
1717
1818jobs :
19- compute_current :
20- name : " Generate current"
19+ compute_diff :
2120 runs-on : ubuntu-latest
2221
2322 steps :
2423 - if : github.event_name == 'pull_request'
2524 name : Checkout
2625 uses : actions/checkout@v4
27- with :
28- # Checkout main branch to generate schema for current release
29- ref : master
3026
3127 - if : github.event_name == 'workflow_dispatch'
3228 name : Checkout
@@ -44,102 +40,7 @@ jobs:
4440 with :
4541 terraform_wrapper : false
4642
47- - run : make install
48-
49- - name : Generate provider schema
50- shell : bash
51- run : |
52- set -ex
53- cd /tmp
54- cat > main.tf <<EOF
55- terraform {
56- required_providers {
57- databricks = {
58- source = "databricks/databricks"
59- }
60- }
61- }
62- EOF
63- terraform init
64- terraform providers schema -json > provider.json
65-
66- - name : ' Upload provider schema'
67- uses : actions/upload-artifact@v3
68- with :
69- name : schema-current
70- path : /tmp/provider.json
71- retention-days : 1
72-
73- compute_new :
74- name : " Generate new"
75- runs-on : ubuntu-latest
76-
77- steps :
78- - if : github.event_name == 'pull_request'
79- name : Checkout
80- uses : actions/checkout@v4
81-
82- - if : github.event_name == 'workflow_dispatch'
83- name : Checkout
84- uses : actions/checkout@v4
85- with :
86- ref : ${{ github.event.inputs.head }}
87-
88- - name : ' Setup Go'
89- uses : actions/setup-go@v4
90- with :
91- go-version : 1.21.x
92-
93- - name : ' Setup Terraform'
94- uses : hashicorp/setup-terraform@v2
95- with :
96- terraform_wrapper : false
97-
98- - run : make install
99-
100- - name : Generate provider schema
101- shell : bash
102- run : |
103- set -ex
104- cd /tmp
105- cat > main.tf <<EOF
106- terraform {
107- required_providers {
108- databricks = {
109- source = "databricks/databricks"
110- }
111- }
112- }
113- EOF
114- terraform init
115- terraform providers schema -json > provider.json
116-
117- - name : ' Upload provider schema'
118- uses : actions/upload-artifact@v3
119- with :
120- name : schema-new
121- path : /tmp/provider.json
122- retention-days : 1
123-
124- diff :
125- needs : [compute_current, compute_new]
126-
127- name : " Compute diff"
128- runs-on : ubuntu-latest
129-
130- steps :
131- - name : ' Setup Go'
132- uses : actions/setup-go@v4
133- with :
134- go-version : 1.21.x
135- cache : false
136-
137- - run : go install github.com/josephburnett/jd@latest
138-
139- - name : ' Download provider schemas'
140- uses : actions/download-artifact@v3
141-
142- - run : ls -l schema*/*
43+ - name : ' Install jd'
44+ run : go install github.com/josephburnett/jd@latest
14345
144- - run : jd -color schema-current/provider.json schema-new/provider.json
145- continue-on-error : true
46+ - run : make diff-schema
0 commit comments