Skip to content

Commit 8534e12

Browse files
committed
Implement github action to lint and validate JSON files
1 parent 686203a commit 8534e12

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: JSON Schema Validation
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
validate-json:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Install sourcemeta json schema cli
18+
uses: sourcemeta/jsonschema@main
19+
20+
- name: Lint JSON files
21+
run: |
22+
echo "Linting JSON files..."
23+
set -e # Exit on any error
24+
echo "Linting softbinding-algorithm-list.json..."
25+
jsonschema lint softbinding-algorithm-list.json
26+
echo "✓ softbinding-algorithm-list.json passed linting"
27+
28+
echo "Linting softbinding-algorithm-entry-schema.json..."
29+
jsonschema lint softbinding-algorithm-entry-schema.json
30+
echo "✓ softbinding-algorithm-entry-schema.json passed linting"
31+
32+
- name: Validate against schema
33+
run: |
34+
echo "Validating softbinding-algorithm-list.json against schema..."
35+
set -e # Exit on any error
36+
jsonschema validate softbinding-algorithm-list.json --schema softbinding-algorithm-entry-schema.json
37+
echo "✓ softbinding-algorithm-list.json is valid against the schema"

0 commit comments

Comments
 (0)