diff --git a/.github/workflows/sycl-windows-build.yml b/.github/workflows/sycl-windows-build.yml index bd6ea38d5f738..bf049ca1c3eb2 100644 --- a/.github/workflows/sycl-windows-build.yml +++ b/.github/workflows/sycl-windows-build.yml @@ -80,7 +80,11 @@ jobs: with: sparse-checkout: | devops/actions - ref: ${{ inputs.ref || github.sha }} + ref: ${{ inputs.ref || github.sha }} + - name: Detect hung tests + shell: powershell + if: always() + uses: ./devops/actions/detect_hung_tests - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 with: arch: amd64 @@ -182,3 +186,7 @@ jobs: name: sycl_windows_default path: ${{ inputs.artifact_archive_name }} retention-days: ${{ inputs.retention-days }} + - name: Detect hung tests + shell: powershell + if: always() + uses: ./devops/actions/detect_hung_tests diff --git a/.github/workflows/sycl-windows-run-tests.yml b/.github/workflows/sycl-windows-run-tests.yml index 3a941ac4c4f8e..625573baa35fb 100644 --- a/.github/workflows/sycl-windows-run-tests.yml +++ b/.github/workflows/sycl-windows-run-tests.yml @@ -52,6 +52,10 @@ jobs: sparse-checkout: | devops/actions ref: ${{ inputs.ref || github.sha }} + - name: Detect hung tests + shell: powershell + if: always() + uses: ./devops/actions/detect_hung_tests - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 with: arch: amd64 @@ -104,15 +108,7 @@ jobs: - name: Detect hung tests shell: powershell if: always() - run: | - $exitCode = 0 - $hungTests = Get-Process | Where-Object { ($_.Path -match "llvm\\install") -or ($_.Path -match "llvm\\build-e2e") } - $hungTests | Foreach-Object { - $exitCode = 1 - echo "Test $($_.Path) hung!" - Stop-Process -Force $_ - } - exit $exitCode + uses: ./devops/actions/detect_hung_tests - name: Cleanup shell: cmd if: always() diff --git a/devops/actions/detect_hung_tests/action.yml b/devops/actions/detect_hung_tests/action.yml new file mode 100644 index 0000000000000..878067f0fc31a --- /dev/null +++ b/devops/actions/detect_hung_tests/action.yml @@ -0,0 +1,16 @@ +name: Detect hung tests + +runs: + using: "composite" + steps: + - name: Detect hung tests + shell: powershell + run: | + $exitCode = 0 + $hungTests = Get-Process | Where-Object { ($_.Path -match "llvm\\install") -or ($_.Path -match "llvm\\build-e2e") } + $hungTests | Foreach-Object { + $exitCode = 1 + echo "Test $($_.Path) hung!" + Stop-Process -Force $_ + } + exit $exitCode