Skip to content

Commit

Permalink
Compatible with different platforms. (opea-project#766)
Browse files Browse the repository at this point in the history
* 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>
Signed-off-by: Chun Tao <[email protected]>
  • Loading branch information
2 people authored and ctao456 committed Oct 9, 2024
1 parent 7d08835 commit 824657e
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/_run-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
get-test-case:
runs-on: ubuntu-latest
outputs:
test_cases: ${{ steps.test-case-matrix.outputs.test_cases }}
run_matrix: ${{ steps.test-case-matrix.outputs.run_matrix }}
CHECKOUT_REF: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }}
steps:
- name: Get checkout ref
Expand All @@ -49,19 +49,31 @@ jobs:
id: test-case-matrix
run: |
set -x
run_matrix="{\"include\":["
service_l=$(echo ${{ inputs.service }} | tr '[:upper:]' '[:lower:]')
cd ${{ github.workspace }}/tests
test_cases=$(find . -type f -name "test_${service_l}*.sh" -print | jq -R '.' | jq -sc '.')
echo "test_cases=$test_cases" >> $GITHUB_OUTPUT
# TODO: get hardware for test matrix
# test_cases=$(find . -type f -name "test_${service_l}*.sh" -print | jq -R '.' | jq -sc '.')
test_cases=$(find . -type f -name "test_${service_l}*.sh")
for script in $test_cases; do
echo $script
if echo "$script" | grep -q "on"; then
hardware=$(echo $script | cut -d'/' -f3 | cut -d'.' -f1 | awk -F'on_' '{print $2}')
run_matrix="${run_matrix}{\"test_case\":\"${script}\",\"hardware\":\"${hardware}\"},"
else
run_matrix="${run_matrix}{\"test_case\":\"${script}\",\"hardware\":\"intel_cpu\"},"
fi
done
run_matrix=$(echo "$run_matrix" | sed 's/,$//')
run_matrix=$run_matrix"]}"
echo "run_matrix=${run_matrix}"
echo "run_matrix=${run_matrix}" >> $GITHUB_OUTPUT
run-test:
needs: [get-test-case]
strategy:
matrix:
test_case: ${{ fromJSON(needs.get-test-case.outputs.test_cases) }}
fail-fast: false
runs-on: gaudi
include: ${{ fromJSON(needs.get-test-case.outputs.run_matrix).include }}
runs-on: ${{ matrix.hardware }}
continue-on-error: true
steps:
- name: Clean up Working Directory
Expand All @@ -86,6 +98,7 @@ jobs:
PINECONE_KEY: ${{ secrets.PINECONE_KEY }}
service: ${{ inputs.service }}
test_case: ${{ matrix.test_case }}
hardware: ${{ matrix.hardware }}
run: |
cd ${{ github.workspace }}/tests
service=$(echo "${test_case}" | cut -d'_' -f2- |cut -d'.' -f1)
Expand Down

0 comments on commit 824657e

Please sign in to comment.