From f00da33837ff141709b1380bee0bef69a433b442 Mon Sep 17 00:00:00 2001 From: Alexis Romero Date: Thu, 16 Feb 2023 06:54:23 +0100 Subject: [PATCH] gh actions: simplified collector job in build-and-test-all.yml --- .github/workflows/build-and-test-all.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index 69033f5873..088485fcb0 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -103,6 +103,7 @@ jobs: needs: - build-dnsdist - test-dnsdist-regression + if: success() || failure() runs-on: ubuntu-20.04 steps: - name: Install jq and yq @@ -114,13 +115,11 @@ jobs: fetch-depth: 5 submodules: recursive ref: ${{ inputs.branch-name }} - - name: Install yq - run: sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq - - name: Get full list of jobs for this workflow - run: yq e '.jobs | keys' .github/workflows/build-and-test-all.yml | grep -v '^- collect' | sort | tee /tmp/workflow-jobs-list.yml - - name: Get list of jobs the collect job depends on - run: yq e '.jobs.collect.needs | ... comments=""' .github/workflows/build-and-test-all.yml | sort | tee /tmp/workflow-collect-dependencies.yml - - name: Diff them - run: diff -u /tmp/workflow-jobs-list.yml /tmp/workflow-collect-dependencies.yml + - name: Get list of jobs in the workflow + run: "yq e '.jobs | keys' .github/workflows/build-and-test-all.yml | awk '{print $2}' | grep -v collect | sort | tee /tmp/workflow-jobs-list.yml" + - name: Get list of prerequisite jobs + run: "echo '${{ toJSON(needs) }}' | jq 'keys | .[]' | tr -d '\"' | sort | tee /tmp/workflow-needs-list.yml" + - name: Fail if there is a job missing on the needs list + run: "if ! diff -q /tmp/workflow-jobs-list.yml /tmp/workflow-needs-list.yml; then exit 1; fi" # FIXME: if we can make upload/download-artifact fasts, running unit tests outside of build can let regression tests start earlier -- 2.47.2