From: romeroalx Date: Fri, 5 Apr 2024 10:02:55 +0000 (+0200) Subject: gh actions - replace yq snap in collect job build-and-test-all X-Git-Tag: dnsdist-1.8.4~9^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0ca5c70811af52619ea54da5cc3a062e8388ebc;p=thirdparty%2Fpdns.git gh actions - replace yq snap in collect job build-and-test-all --- diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index 080296b53b..cb3a326d69 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -111,19 +111,19 @@ jobs: if: success() || failure() runs-on: ubuntu-20.04 steps: - - name: Install jq and yq - run: "sudo snap install jq yq" + - name: Install jq and jc + run: "sudo apt-get update && sudo apt-get install jq jc" - name: Fail job if any of the previous jobs failed - run: "for i in `echo '${{ toJSON(needs) }}' | jq '.[].result' | tr -d '\"'`; do if [[ $i == 'failure' ]]; then echo '${{ toJSON(needs) }}'; exit 1; fi; done;" + run: "for i in `echo '${{ toJSON(needs) }}' | jq -r '.[].result'`; do if [[ $i == 'failure' ]]; then echo '${{ toJSON(needs) }}'; exit 1; fi; done;" - uses: actions/checkout@v3 with: fetch-depth: 5 submodules: recursive ref: ${{ inputs.branch-name }} - 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" + run: "cat .github/workflows/build-and-test-all.yml | jc --yaml | jq -rS '.[].jobs | keys | .[]' | grep -v collect | 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" + run: "echo '${{ toJSON(needs) }}' | jq -rS 'keys | .[]' | 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"