Skip to content

Commit 20f5000

Browse files
chensuyueChingis Yundunov
authored andcommitted
Expand CI test scope for common test scripts (opea-project#1554)
Expand CI test scope, trigger all hw test when the common test scripts changed. Signed-off-by: chensuyue <[email protected]> Signed-off-by: Chingis Yundunov <[email protected]>
1 parent 845c476 commit 20f5000

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/_run-docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
fi
8686
done
8787
88+
if [ -z "$run_test_cases" ] && [[ $(printf '%s\n' "${changed_files[@]}" | grep ${{ inputs.example }} | grep /tests/) ]]; then
89+
run_test_cases=$other_test_cases
90+
fi
91+
8892
test_cases=$(echo $run_test_cases | tr ' ' '\n' | sort -u | jq -R '.' | jq -sc '.')
8993
echo "test_cases=$test_cases"
9094
echo "test_cases=$test_cases" >> $GITHUB_OUTPUT

.github/workflows/scripts/get_test_matrix.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ for example in ${examples}; do
2626

2727
run_hardware=""
2828
if [[ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | cut -d'/' -f2 | grep -E '\.py|Dockerfile*|ui|docker_image_build' ) ]]; then
29-
# run test on all hardware if megaservice or ui code change
29+
echo "run test on all hardware if megaservice or ui code change..."
30+
run_hardware=$hardware_list
31+
elif [[ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | grep 'tests'| cut -d'/' -f3 | grep -vE '^test_|^_test' ) ]]; then
32+
echo "run test on all hardware if common test scripts change..."
3033
run_hardware=$hardware_list
3134
else
3235
for hardware in ${hardware_list}; do

0 commit comments

Comments
 (0)