Merge commit '939177be6b30bd19dd3acfc1ae85690b83803234' as 'acm-hub-bootstrap'
This commit is contained in:
49
acm-hub-bootstrap/.github/workflows/jsonschema.yaml
vendored
Normal file
49
acm-hub-bootstrap/.github/workflows/jsonschema.yaml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user