Skip to content

Commit 4e5de17

Browse files
Compatible with different platforms. (opea-project#766)
* Compatible with different platforms. Signed-off-by: ZePan110 <[email protected]> * Fix issue. Signed-off-by: ZePan110 <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix issue Signed-off-by: ZePan110 <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: ZePan110 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5d0c436 commit 4e5de17

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
get-test-case:
2525
runs-on: ubuntu-latest
2626
outputs:
27-
test_cases: ${{ steps.test-case-matrix.outputs.test_cases }}
27+
run_matrix: ${{ steps.test-case-matrix.outputs.run_matrix }}
2828
CHECKOUT_REF: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }}
2929
steps:
3030
- name: Get checkout ref
@@ -49,19 +49,31 @@ jobs:
4949
id: test-case-matrix
5050
run: |
5151
set -x
52+
run_matrix="{\"include\":["
5253
service_l=$(echo ${{ inputs.service }} | tr '[:upper:]' '[:lower:]')
5354
cd ${{ github.workspace }}/tests
54-
test_cases=$(find . -type f -name "test_${service_l}*.sh" -print | jq -R '.' | jq -sc '.')
55-
echo "test_cases=$test_cases" >> $GITHUB_OUTPUT
56-
# TODO: get hardware for test matrix
55+
# test_cases=$(find . -type f -name "test_${service_l}*.sh" -print | jq -R '.' | jq -sc '.')
56+
test_cases=$(find . -type f -name "test_${service_l}*.sh")
57+
for script in $test_cases; do
58+
echo $script
59+
if echo "$script" | grep -q "on"; then
60+
hardware=$(echo $script | cut -d'/' -f3 | cut -d'.' -f1 | awk -F'on_' '{print $2}')
61+
run_matrix="${run_matrix}{\"test_case\":\"${script}\",\"hardware\":\"${hardware}\"},"
62+
else
63+
run_matrix="${run_matrix}{\"test_case\":\"${script}\",\"hardware\":\"intel_cpu\"},"
64+
fi
65+
done
66+
run_matrix=$(echo "$run_matrix" | sed 's/,$//')
67+
run_matrix=$run_matrix"]}"
68+
echo "run_matrix=${run_matrix}"
69+
echo "run_matrix=${run_matrix}" >> $GITHUB_OUTPUT
5770
5871
run-test:
5972
needs: [get-test-case]
6073
strategy:
6174
matrix:
62-
test_case: ${{ fromJSON(needs.get-test-case.outputs.test_cases) }}
63-
fail-fast: false
64-
runs-on: gaudi
75+
include: ${{ fromJSON(needs.get-test-case.outputs.run_matrix).include }}
76+
runs-on: ${{ matrix.hardware }}
6577
continue-on-error: true
6678
steps:
6779
- name: Clean up Working Directory
@@ -86,6 +98,7 @@ jobs:
8698
PINECONE_KEY: ${{ secrets.PINECONE_KEY }}
8799
service: ${{ inputs.service }}
88100
test_case: ${{ matrix.test_case }}
101+
hardware: ${{ matrix.hardware }}
89102
run: |
90103
cd ${{ github.workspace }}/tests
91104
service=$(echo "${test_case}" | cut -d'_' -f2- |cut -d'.' -f1)

0 commit comments

Comments
 (0)