CI: kernel: skip subtarget test on non-specific target test
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 19 Feb 2023 22:35:42 +0000 (23:35 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 21 Mar 2023 23:36:33 +0000 (00:36 +0100)
Reduce testing time by skipping subtarget test on non-specific target
test.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
.github/workflows/kernel.yml

index 6a94e7977987bdb77d1fcffe6627f699645eaa72..a25829a4c0ec99172ec6a3127054635581b694d3 100644 (file)
@@ -52,6 +52,12 @@ jobs:
           TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1 | awk '{ print $1 }')"
           TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1 | awk '{ print $1 }')"
 
+          # On testing non-specific target, skip testing each subtarget
+          if echo "$CHANGED_FILES" | grep -v -q target/linux ||
+            echo "$CHANGED_FILES" | grep -q target/linux/generic; then
+            TARGETS_SUBTARGETS=$TARGETS
+          fi
+
           JSON_TARGETS_SUBTARGETS='['
           FIRST=1
           for TARGET in $TARGETS_SUBTARGETS; do