Skip to content

Commit

Permalink
ci/workflow: add schema validation
Browse files Browse the repository at this point in the history
This commit adds schema validation for conformance
tests action files

Signed-off-by: Birol Bilgin <birol@cilium.io>
  • Loading branch information
brlbil committed Jun 21, 2023
1 parent e0b55fd commit 236187d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,33 @@ jobs:
for type in focus k8s-versions prs scheduled; do
yamale -s ${type}-schema.yaml *-${type}.yaml;
done
conformance-schema-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: '3.10'
- run: pip install yamale
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
persist-credentials: false
# hard-code the path instead of using ${{ github.repository }} to make sure it works for forked repo as well
path: src/github.com/cilium/cilium

- name: Validate schema of aws, azure and gke action files
shell: bash
run: |
for dir in aws azure gke;do
dir_base=".github/actions/${dir}"
file_base="${dir_base}/k8s-versions"
if [ -f ${file_base}.yaml ];then
yamale -s ${file_base}-schema.yaml ${file_base}.yaml;
fi
if [ -f ${dir_base}/test-config-schema.yaml ];then
yamale -s ${dir_base}/test-config-schema.yaml ${dir_base}/test-config-classic.yaml
yamale -s ${dir_base}/test-config-schema.yaml ${dir_base}/test-config-helm.yaml
fi
done

0 comments on commit 236187d

Please sign in to comment.