Skip to content

Commit

Permalink
update deploy method for get test matrix
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue committed Sep 9, 2024
1 parent f6baff5 commit ac65fe0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/_get-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: false
type: string
default: '.github|README.md|*.txt'
deploy_method:
required: false
type: string
default: 'docker_compose'
outputs:
run_matrix:
description: "The matrix string"
Expand Down Expand Up @@ -53,5 +57,7 @@ jobs:
changed_files="$(git diff --name-only ${base_commit} ${merged_commit} | \
grep -vE '${{ inputs.diff_excluded_files }}')" || true
echo "changed_files=$changed_files"
changed_files=$changed_files bash .github/workflows/scripts/get_test_matrix.sh
export changed_files=$changed_files
export deploy_method=${{ inputs.deploy_method }}
bash .github/workflows/scripts/get_test_matrix.sh
echo "run_matrix=${run_matrix}"
1 change: 1 addition & 0 deletions .github/workflows/pr-gmc-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
uses: ./.github/workflows/_get-test-matrix.yml
with:
diff_excluded_files: '.github|docker_compose|manifest|assets|*.md|*.txt'
deploy_method: "gmc"

gmc-test:
needs: [job1]
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-manifest-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
job1:
uses: ./.github/workflows/_get-test-matrix.yml
with:
diff_excluded_files: '.github|docker_compose|gmc|assets|*.md|*.txt'
diff_excluded_files: '.github|docker_compose|gmc|assets|*.md|*.txt|benchmark'
deploy_method: "manifest"

run-example:
needs: job1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/scripts/get_test_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@

set -e
changed_files=$changed_files
deploy_method=$deploy_method
run_matrix="{\"include\":["
hardware_list="xeon gaudi" # current support hardware list

examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
for example in ${examples}; do
cd $example
if [[ ! $(find . -type f | grep ${deploy_method}) ]]; then continue; fi

run_hardware=""
if [[ $(printf '%s\n' "${changed_files[@]}" | grep ${example} | cut -d'/' -f2 | grep -E '*.py|Dockerfile*|ui|docker_image_build' ) ]]; then
# run test on all hardware if megaservice or ui code change
Expand Down

0 comments on commit ac65fe0

Please sign in to comment.