Zuul: Add basic validation script

See: https://pagure.io/fedora-comps/issue/785
This commit is contained in:
Timothée Ravier 2023-02-03 12:58:20 +01:00 committed by adamwill
parent 852152c526
commit f3d5b63793
3 changed files with 36 additions and 0 deletions

9
.zuul.yaml Normal file
View File

@ -0,0 +1,9 @@
- project:
check:
jobs:
- validate
- job:
name: validate
description: Validate comps files
run: ci/validate.yaml

21
ci/validate Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/bash
set -euxo pipefail
main() {
failure="false"
make sort || failure="true"
make validate || failure="true"
# Fail if any changes were made to the repo
if [[ -n "(git status --short)" ]]; then
failure="true"
fi
if [[ "${failure}" == "true" ]]; then
echo "At least one check failed!"
exit 1
fi
}
main "${@}"

6
ci/validate.yaml Normal file
View File

@ -0,0 +1,6 @@
- hosts: all
tasks:
- name: Validate comps files
ansible.builtin.command:
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
cmd: ci/validate