-
Notifications
You must be signed in to change notification settings - Fork 291
59 lines (50 loc) · 2.05 KB
/
Copy pathjsonschema.yaml
File metadata and controls
59 lines (50 loc) · 2.05 KB
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: Verify json schema
on: [push, pull_request]
jobs:
jsonschema_tests:
name: Json Schema tests
strategy:
matrix:
python-version: [3.11]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install check-jsonschema
- name: Install yq
uses: chrisdickinson/setup-yq@3d931309f27270ebbafd53f2daee773a82ea1822 # v1.0.1
with:
yq-version: v4.30.7
- name: Verify secrets json schema against templates
run: |
cp ./values-secret.yaml.template ./values-secret.yaml
check-jsonschema --fill-defaults --schemafile https://raw.githubusercontent.com/validatedpatterns/rhvp.cluster_utils/refs/heads/main/roles/vault_utils/values-secrets.v2.schema.json values-secret.yaml
rm -f ./values-secret.yaml
- name: Verify ClusterGroup values.schema.json against values-*yaml files
run: |
set -e
find . -maxdepth 1 -type f -name "values-*.yaml" ! -name "values-global.yaml" -print0 | while IFS= read -r -d '' i;
do
if [[ "$i" =~ 4\.[0-9]+ ]]; then
echo "Skipping $i"
continue
fi
echo "$i"
# disable shellcheck of single quotes in yq
# shellcheck disable=2016
yq eval-all '. as $item ireduce ({}; . * $item )' values-global.yaml "$i" > tmp.yaml
check-jsonschema --fill-defaults --schemafile https://raw.githubusercontent.com/validatedpatterns/clustergroup-chart/refs/heads/main/values.schema.json tmp.yaml
rm -f tmp.yaml
done