forked from spdx/spdx-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.4 KB
/
validate_examples.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
on:
- pull_request
- push
jobs:
validate-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Install python dependencies
run: |
python3 -m pip install pyshacl==0.25.0 check-jsonschema==0.28.1
- name: Install dependencies
run: |
sudo apt install -y gawk
- name: Check files
run: |
set -e
for f in examples/jsonld/*.json; do
echo "Checking $f"
check-jsonschema \
-v \
--schemafile https://spdx.org/schema/3.0.0/spdx-json-schema.json \
$f
pyshacl \
-s https://spdx.org/rdf/3.0.0/spdx-model.ttl \
-e https://spdx.org/rdf/3.0.0/spdx-model.ttl \
$f
done
- name: Check documentation examples
run: |
for f in $(grep -l '```json' docs/annexes/*.md); do
echo "Checking $f"
cat $f | awk '/^```json/, $0=="```" {if ($0 !~ /^```.*/ ) print}' > temp.json
check-jsonschema \
-v \
--schemafile https://spdx.org/schema/3.0.0/spdx-json-schema.json \
temp.json
pyshacl \
-s https://spdx.org/rdf/3.0.0/spdx-model.ttl \
-e https://spdx.org/rdf/3.0.0/spdx-model.ttl \
temp.json
done