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