From f3d5b637931686e17ea9d83d7690b6f0486dbcab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Fri, 3 Feb 2023 12:58:20 +0100 Subject: [PATCH] Zuul: Add basic validation script See: https://pagure.io/fedora-comps/issue/785 --- .zuul.yaml | 9 +++++++++ ci/validate | 21 +++++++++++++++++++++ ci/validate.yaml | 6 ++++++ 3 files changed, 36 insertions(+) create mode 100644 .zuul.yaml create mode 100755 ci/validate create mode 100644 ci/validate.yaml diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 00000000..c430dd75 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,9 @@ + - project: + check: + jobs: + - validate + + - job: + name: validate + description: Validate comps files + run: ci/validate.yaml diff --git a/ci/validate b/ci/validate new file mode 100755 index 00000000..e81b1d96 --- /dev/null +++ b/ci/validate @@ -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 "${@}" diff --git a/ci/validate.yaml b/ci/validate.yaml new file mode 100644 index 00000000..cf7251a3 --- /dev/null +++ b/ci/validate.yaml @@ -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