File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 44
44
outputs :
45
45
commits : ${{ toJSON(steps.*.outputs.*) }}
46
46
47
- ubuntu_22_schema :
47
+ ubuntu_22_json :
48
48
runs-on : ubuntu-22.04
49
49
needs : commit_list
50
50
strategy :
60
60
- name : Install check-jsonschema
61
61
run : pipx install check-jsonschema
62
62
63
- - name : Check JSON schema
63
+ - name : Update jq
64
+ run : |
65
+ sudo apt update
66
+ sudo apt install jq
67
+
68
+ - name : Check schema format
69
+ run : diff -u ./schema/landlockconfig.json <(jq < ./schema/landlockconfig.json)
70
+
71
+ - name : Check JSON
64
72
run : ./schema/check.sh examples/mini-write-tmp.json
65
73
66
74
ubuntu_22_rust_msrv :
Original file line number Diff line number Diff line change @@ -4,4 +4,26 @@ set -u -e -o pipefail
4
4
5
5
BASE_DIR=$( dirname " ${BASH_SOURCE[0]} " )
6
6
7
- check-jsonschema --schemafile " ${BASE_DIR} /landlockconfig.json" " $@ "
7
+ if [[ $# -eq 0 ]]; then
8
+ echo " ERROR: No files to check" >&2
9
+ exit 1
10
+ fi
11
+
12
+ for file in " $@ " ; do
13
+ if [[ ! -r " ${file} " ]]; then
14
+ echo " ERROR: Invalid file: ${file} " >&2
15
+ exit 1
16
+ fi
17
+
18
+ diff -u " ${file} " <( jq < " ${file} " ) || {
19
+ echo
20
+ echo " ERROR: Invalid formatting" >&2
21
+ exit 1
22
+ }
23
+
24
+ check-jsonschema --schemafile " ${BASE_DIR} /landlockconfig.json" " ${file} " || {
25
+ echo
26
+ echo " ERROR: Not validated by schema: ${file} " >&2
27
+ exit 1
28
+ }
29
+ done
You can’t perform that action at this time.
0 commit comments