From 7057d38a870a2b0e199b4789026ece4b0c79d1c2 Mon Sep 17 00:00:00 2001 From: vindard <17693119+vindard@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:14:15 -0400 Subject: [PATCH] ci: run all tests if any ci changes are made --- .../workflows/check-code-and-unit-test.yaml | 18 +++++++++++++----- .github/workflows/integration-test.yml | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check-code-and-unit-test.yaml b/.github/workflows/check-code-and-unit-test.yaml index 405934fef4..5b2444980f 100644 --- a/.github/workflows/check-code-and-unit-test.yaml +++ b/.github/workflows/check-code-and-unit-test.yaml @@ -31,13 +31,21 @@ jobs: DEFAULT_LABELS=("dashboard" "consent" "pay" "core" "api-keys" "notifications" "admin-panel" "map") LABELS=($(jq -r '.[]' < labels.json)) - if [ ${#LABELS[@]} -eq 0 ]; then - LABELS=("${DEFAULT_LABELS[@]}") - elif [ ${#LABELS[@]} -eq 1 ] && [ "${LABELS[0]}" = "ci" ]; then - LABELS=("${DEFAULT_LABELS[@]}") + + found_ci=0 + for label in "${LABELS[@]}"; do + if [ "$label" = "ci" ]; then + found_ci=1 + break + fi + done + + UPDATED_LABELS=("${LABELS[@]}") + if [ ${#LABELS[@]} -eq 0 ] || [ $found_ci -eq 1 ]; then + UPDATED_LABELS=("${DEFAULT_LABELS[@]}") fi - for LABEL in "${LABELS[@]}"; do + for LABEL in "${UPDATED_LABELS[@]}"; do case "$LABEL" in dashboard|consent|pay|admin-panel|map) ARGS+=" //apps/$LABEL:test" diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 4d9234f3af..5f050a88fb 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -29,13 +29,21 @@ jobs: DEFAULT_LABELS=("dashboard" "consent" "pay" "core" "admin-panel" "map") LABELS=($(jq -r '.[]' < labels.json)) - if [ ${#LABELS[@]} -eq 0 ]; then - LABELS=("${DEFAULT_LABELS[@]}") - elif [ ${#LABELS[@]} -eq 1 ] && [ "${LABELS[0]}" = "ci" ]; then - LABELS=("${DEFAULT_LABELS[@]}") + + found_ci=0 + for label in "${LABELS[@]}"; do + if [ "$label" = "ci" ]; then + found_ci=1 + break + fi + done + + UPDATED_LABELS=("${LABELS[@]}") + if [ ${#LABELS[@]} -eq 0 ] || [ $found_ci -eq 1 ]; then + UPDATED_LABELS=("${DEFAULT_LABELS[@]}") fi - for LABEL in "${LABELS[@]}"; do + for LABEL in "${UPDATED_LABELS[@]}"; do case "$LABEL" in dashboard|consent|pay|core|admin-panel|map) ARGS+=" $LABEL"