From 722a6b3dc093992d21ffcebb8a84dc4d676944ad Mon Sep 17 00:00:00 2001 From: Pranav Gaikwad Date: Fri, 20 Oct 2023 11:17:27 -0400 Subject: [PATCH] :sparkles: improve CI Signed-off-by: Pranav Gaikwad --- .github/workflows/testing.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index e84e54b..2d4b22b 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -26,9 +26,13 @@ jobs: run: | expected_file=./test-data/analysis-output.yaml actual_file=./output/output.yaml - sed 's/^[ \t-]*//' $expected_file | sort -s > /tmp/expected_file - sed 's/^[ \t-]*//' $actual_file | sort -s > /tmp/actual_file - diff /tmp/expected_file /tmp/actual_file || diff $expected_file $actual_file + function filter_and_sort() { + yq e 'del(.[].skipped) | del(.[].unmatched)' $1 > /tmp/filtered + yq e '(.[] | select(.violations != null) | .violations |= (. | to_entries | sort_by(.key) | from_entries))' /tmp/filtered > $1 + } + filter_and_sort $expected_file + filter_and_sort $actual_file + diff $expected_file $actual_file - name: Fail if dependencies output does not match expected run: |