Skip to content

Commit feb2b2a

Browse files
committed
feat: even more validating
1 parent 2adea8a commit feb2b2a

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ jobs:
4545
- name: Install Node.js dependencies
4646
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
4747

48-
- name: Install validation tooling
49-
run: "pip install check-jsonschema"
50-
5148
- name: Build with Hugo
5249
env:
5350
# For maximum backward compatibility with Hugo modules
@@ -56,6 +53,15 @@ jobs:
5653
run: |
5754
hugo --minify
5855
56+
- name: Install validation tooling
57+
run: "pip install check-jsonschema"
58+
59+
- name: Validation tooling cache
60+
uses: actions/cache@v4
61+
with:
62+
path: ~/.cache/check_jsonschema/
63+
key: validation_tooling
64+
5965
- name: Validate page build
6066
run: |
6167
bash validate.sh

validate.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,25 @@ BASE="public"
88
pushd $BASE
99

1010
# Validate json files
11+
echo "Validating json files"
1112
for json in $(find . -iname "*.json" -type f); do
12-
echo "Validating $json..."
13+
echo "$json..."
1314
jq . "$json" 1> /dev/null
1415
done
1516

1617
if command -v check-jsonschema >/dev/null 2>&1; then
1718
echo
18-
echo "Validating human.json against JSON schema..."
19+
20+
echo "Validating json files against known JSON schemata..."
21+
22+
echo "./human.json..."
1923
check-jsonschema --schemafile https://codeberg.org/robida/human.json/raw/branch/main/schema/0.1.1.json human.json
24+
25+
# jsonfeed
26+
for feed in $(find . -iname "feed.json" -type f); do
27+
echo "$feed..."
28+
check-jsonschema --schemafile https://raw.githubusercontent.com/sonicdoe/jsonfeed-schema/refs/heads/master/schema-v1.1.json "$feed"
29+
done
2030
fi
2131

2232
popd

0 commit comments

Comments
 (0)