Skip to content

Commit 38f6461

Browse files
authored
CI optimization to support multiple test for single kind of service (#145)
Signed-off-by: chensuyue <suyue.chen@intel.com>
1 parent 7dbad07 commit 38f6461

5 files changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/microservice-test.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,26 @@ jobs:
3838
changed_files="$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${merged_commit} \
3939
| grep 'comps/' | grep -vE '*.md|*.txt|comps/cores')" || true
4040
services=$(printf '%s\n' "${changed_files[@]}" | cut -d'/' -f2 | grep -vE '*.py' | sort -u)
41+
path_level_1=("asr" "tts")
42+
path_level_3=("llms")
4143
run_matrix="{\"include\":["
4244
for service in ${services}; do
4345
hardware="gaudi" # default hardware, set based on the changed files
44-
run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"},"
46+
if [[ "${path_level_1[@]}" =~ "${service}" ]]; then
47+
run_matrix="${run_matrix}{\"service\":\"${service}\",\"hardware\":\"${hardware}\"},"
48+
else
49+
vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | cut -d'/' -f3 | grep -vE '*.py' | sort -u)
50+
for vendor in ${vendors}; do
51+
if [[ "${path_level_3[@]}" =~ "${service}" ]]; then
52+
sub_vendors=$(printf '%s\n' "${changed_files[@]}" | grep ${service} | grep ${vendor} | cut -d'/' -f4 | grep -vE '*.py' | sort -u)
53+
for sub_vendor in ${sub_vendors}; do
54+
run_matrix="${run_matrix}{\"service\":\"${service}_${vendor}_${sub_vendor}\",\"hardware\":\"${hardware}\"},"
55+
done
56+
else
57+
run_matrix="${run_matrix}{\"service\":\"${service}_${vendor}\",\"hardware\":\"${hardware}\"},"
58+
fi
59+
done
60+
fi
4561
done
4662
run_matrix=$run_matrix"]}"
4763
echo "run_matrix=${run_matrix}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)