git-subtree-dir: acm-hub-bootstrap git-subtree-split: 4b79b1a0be6da2a9efc9ace8871b4762342da70b
50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
---
|
|
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
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
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@latest
|
|
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; for i in values-hub.yaml values-group-one.yaml; do
|
|
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
|
|
|