Skip to content

Commit 23694dc

Browse files
committed
add json schema tests
1 parent 908568a commit 23694dc

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ jobs:
4646
- name: Install rush
4747
run: curl -Ls http://get.dannyb.co/rush/setup | bash
4848

49-
- name: Install shfmt
50-
run: rush snatch dannyben shfmt
49+
- name: Connect rush repo
50+
run: rush clone dannyben --shallow --default
51+
52+
- name: Install shfmt and check-jsonschema
53+
run: rush add shfmt check-jsonschema
5154

5255
# libyaml needed for Ruby's YAML library
5356
- name: Install OS dependencies
@@ -65,3 +68,5 @@ jobs:
6568
run: bundle exec run shellcheck
6669
- name: Run shfmt tests
6770
run: bundle exec run shfmt
71+
- name: Run schema tests
72+
run: bundle exec run schema

runfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ action :shfmt do
5252
end
5353
end
5454

55+
help "Run json-schema checks on all examples"
56+
action :schema do
57+
Example.all.each do |example|
58+
file = example.yaml_path
59+
command = "check-jsonschema --schemafile schema.json #{file}"
60+
success = system command
61+
color = success ? 'g' : 'r'
62+
say "- check-jsonschema #{color}`#{example.dir}`"
63+
exit 1 unless success
64+
end
65+
end
66+
5567
help "Generate changelog and append old changelog"
5668
action :changelog do
5769
system "git changelog --save"

0 commit comments

Comments
 (0)