diff --git a/.github/workflows/_run-docker-compose.yml b/.github/workflows/_run-docker-compose.yml index 5b89f67b28..c1b6312d09 100644 --- a/.github/workflows/_run-docker-compose.yml +++ b/.github/workflows/_run-docker-compose.yml @@ -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 @@ -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 @@ -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)