From 4b90deb10d13be81ecd256698a14f7e94ce16da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Fri, 1 Mar 2024 18:30:47 +0100 Subject: [PATCH] ci: Split dependency check and run checks all on failures - Split the dependency check into a distinct step for each variant - If the dependency test failed, still run the compose base test to get results about it - Add a step at the end to make sure that if any step fails, the workflow still fail See: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html#ignoring-failed-commands See discussion in: https://pagure.io/workstation-ostree-config/pull-request/493 --- ci/validate.yaml | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/ci/validate.yaml b/ci/validate.yaml index 122cc87..b07f753 100644 --- a/ci/validate.yaml +++ b/ci/validate.yaml @@ -11,15 +11,46 @@ - 'selinux-policy-targeted' state: present become: true + - name: Validate manifests and scripts syntax ansible.builtin.command: chdir: "{{ zuul.project.src_dir }}" cmd: just validate - - name: Perform dependency resolution for all variants - ansible.builtin.command: + + - name: Perform dependency resolution for Silverblue + ansible.builtin.shell: chdir: "{{ zuul.project.src_dir }}" - cmd: just compose-dry-run + cmd: "just compose-dry-run silverblue && touch .zuulci.silverblue" + # Still run the next step if this one fails + ignore_errors: true + + - name: Perform dependency resolution for Kinoite + ansible.builtin.shell: + chdir: "{{ zuul.project.src_dir }}" + cmd: "just compose-dry-run kinoite && touch .zuulci.kinoite" + # Still run the next step if this one fails + ignore_errors: true + + - name: Perform dependency resolution for Sway Atomic + ansible.builtin.shell: + chdir: "{{ zuul.project.src_dir }}" + cmd: "just compose-dry-run sericea && touch .zuulci.sericea" + # Still run the next step if this one fails + ignore_errors: true + + - name: Perform dependency resolution for Budgie Atomic + ansible.builtin.shell: + chdir: "{{ zuul.project.src_dir }}" + cmd: "just compose-dry-run onyx && touch .zuulci.onyx" + # Still run the next step if this one fails + ignore_errors: true + - name: Compose the base variant ansible.builtin.command: chdir: "{{ zuul.project.src_dir }}" cmd: just compose-legacy base + + - name: Check if any previous dependency resolution steps failed + ansible.builtin.shell: + chdir: "{{ zuul.project.src_dir }}" + cmd: "[[ -f .zuulci.silverblue ]] && [[ -f .zuulci.kinoite ]] && [[ -f .zuulci.sericea ]] && [[ -f .zuulci.onyx ]]"