-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.76 KB
/
medata-ci-workflows.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
48
49
50
51
52
53
54
55
56
57
58
name: Metadata CI Workflow
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
# validation of all JSON file to ensure that they contain the right JSON syntaxes and formats
validate-json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: validate-json-files
id: json-validate
uses: GrantBirki/json-yaml-validate@v3
with:
comment: "true"
# validation of campaign JSON file against its schema
- name: Validate campaign JSON
uses: cardinalby/schema-validator-action@v3
with:
schema: ukaea-schema/facility/hive/campaign.schema.json
file: ./ukaea-schema/examples/hive/campaign.json
# validation of experiment JSON file against its schema
- name: Validate experiment JSON
uses: cardinalby/schema-validator-action@v3
with:
schema: ./ukaea-schema/facility/hive/campaign.schema.json
file: ./ukaea-schema/examples/hive/campaign.json
- name: Validate facility JSON
uses: cardinalby/schema-validator-action@v3
with:
schema: ./ukaea-schema/facility/facility.schema.json
file: ./ukaea-schema/examples/facility.json
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
# validation of all JSON files to ensure their keys contains only camelCase.
- name: custom-camel-case-validation
run: |
readarray -d '' json_file_paths < <(find . -name *.json -print0)
echo ${json_file_paths[@]}
for json_file in ${json_file_paths[@]}; do
python validate_camel_case.py $json_file
done