-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.13 KB
/
validate-shapes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Validate Shapes
on:
push:
branches:
- main
- shapes-and-schemas
pull_request:
branches:
- main
- shapes-and-schemas
jobs:
validate-shapes:
runs-on: ubuntu-latest
strategy:
matrix:
folders:
- base/message
- issuance/message
- presentation/message
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Install SHACL Validator
run: |
sudo pipx install pyshacl
- name: Validate Shapes
run: |
for folder in ${{ matrix.folders }}
do
for json_file in $folder/example/*.json
do
_base_filename=$(basename "$json_file" .json)
shape_file="$folder/shape/${_base_filename}-shape.ttl"
if [[ -f "$shape_file" ]]; then
echo "Validating $json_file against $shape_file"
pyshacl -df json-ld -sf turtle -s $shape_file $json_file
else
echo "WARNING: Shape file not found for $json_file"
fi
done
done