Skip to content

Commit ff14fce

Browse files
feat: pipeline who check json validity (#258)
* feat: pipeline who check json validity * feat: test errors * feat: only jsonld * feat: only jsonld * feat: only jsonld * feat: only jsonld * fix: DeviceStation.json * fix: remove space from name * fix: remaining spaces * feat: always check all filer * feat: always check all filer * feat: always check all filer * feat: always check all filer * feat: always check all filer
1 parent dcd42ab commit ff14fce

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Check JSON-LD and JSON files are valid
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- '**'
8+
paths:
9+
- '**/jsonld-contexts/**'
10+
- '**/ngsild-payloads/**'
11+
12+
jobs:
13+
check-context-valid-json:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
19+
- name: Install jq
20+
run: |
21+
sudo apt update && sudo apt install jq
22+
- name: Check JSON and JSON-LD files
23+
run: |
24+
error=0
25+
echo "Checking JSON-LD files"
26+
for file in $(find . -name "*.jsonld"); do
27+
printf "Checking $file .. "
28+
jq empty $file && echo "OK" || { error=1; echo "****************** KO invalid JSON ******************"; }
29+
done
30+
echo ""
31+
echo "Checking JSON files"
32+
for file in $(find . -name "*.json"); do
33+
printf "Checking $file .. "
34+
jq empty $file && echo "OK" || { error=1; echo "****************** KO invalid JSON ******************"; }
35+
done
36+
exit $error
37+
shell: bash
38+
- name: Check JSON files
39+
run: |
40+
error=0
41+
42+
exit $error
43+
shell: bash

archive/precipitation/ngsild-payloads/DeviceStation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
"@context": [
1818
"https://easy-global-market.github.io/ngsild-api-data-models/precipitation/jsonld-contexts/precipitationCompouned.jsonld"
1919
]
20-
}
20+
}
21+
}

0 commit comments

Comments
 (0)