diff --git a/.github/workflows/build-and-test-multiplatform.yml b/.github/workflows/build-and-test-multiplatform.yml index 83bdeb66d9..2c1f53a2af 100644 --- a/.github/workflows/build-and-test-multiplatform.yml +++ b/.github/workflows/build-and-test-multiplatform.yml @@ -420,14 +420,13 @@ jobs: - name: Get latest workflow run ID from target branch id: get_run_id run: | - workflow_name="Build and Test OCCT on Multiple Platforms" - target_branch="${{ github.event.pull_request.base.ref }}" - echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch" - response=$(curl -s \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request") - latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1) - echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV + $workflow_name = "Build and Test OCCT on Multiple Platforms" + $target_branch = "${{ github.event.pull_request.base.ref }}" + Write-Host "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch" + $response = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request" -Headers @{Accept = "application/vnd.github.v3+json"} + $latest_run_id = ($response.workflow_runs | Where-Object { $_.name -eq $workflow_name } | Select-Object -First 1).id + Write-Host "latest_run_id=$latest_run_id" | Out-File -FilePath $env:GITHUB_ENV -Append + shell: pwsh - name: Download test results from target branch uses: actions/download-artifact@v4.1.7 @@ -519,14 +518,13 @@ jobs: - name: Get latest workflow run ID from target branch id: get_run_id run: | - workflow_name="Build and Test OCCT on Multiple Platforms" - target_branch="${{ github.event.pull_request.base.ref }}" - echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch" - response=$(curl -s \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request") - latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1) - echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV + $workflow_name = "Build and Test OCCT on Multiple Platforms" + $target_branch = "${{ github.event.pull_request.base.ref }}" + Write-Host "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch" + $response = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch&status=success&event=pull_request" -Headers @{Accept = "application/vnd.github.v3+json"} + $latest_run_id = ($response.workflow_runs | Where-Object { $_.name -eq $workflow_name } | Select-Object -First 1).id + Write-Host "latest_run_id=$latest_run_id" | Out-File -FilePath $env:GITHUB_ENV -Append + shell: pwsh - name: Download test results from target branch uses: actions/download-artifact@v4.1.7 @@ -632,13 +630,15 @@ jobs: uses: actions/download-artifact@v4.1.7 with: name: results-macos-x64 - path: install + path: install/bin github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ env.latest_run_id }} - name: Compare test results run: | cd install + cd bin + source env.sh for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done for dir in results-macos-x64/*; do export RESULTS_MACOS_SUBFOLDER=$dir; done ./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_MACOS_SUBFOLDER @@ -732,13 +732,15 @@ jobs: uses: actions/download-artifact@v4.1.7 with: name: results-macos-gcc-x64 - path: install + path: install/bin github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ env.latest_run_id }} - name: Compare test results run: | cd install + cd bin + source env.sh for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done for dir in results-macos-gcc-x64/*; do export RESULTS_MACOS_GCC_SUBFOLDER=$dir; done ./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_MACOS_GCC_SUBFOLDER @@ -841,13 +843,15 @@ jobs: uses: actions/download-artifact@v4.1.7 with: name: results-linux-clang-x64 - path: install + path: install/bin github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ env.latest_run_id }} - name: Compare test results run: | cd install + cd bin + source env.sh for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done for dir in results-linux-clang-x64/*; do export RESULTS_LINUX_CLANG_SUBFOLDER=$dir; done ./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_LINUX_CLANG_SUBFOLDER @@ -950,13 +954,15 @@ jobs: uses: actions/download-artifact@v4.1.7 with: name: results-linux-gcc-x64 - path: install + path: install/bin github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ env.latest_run_id }} - name: Compare test results run: | cd install + cd bin + source env.sh for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done for dir in results-linux-gcc-x64/*; do export RESULTS_LINUX_GCC_SUBFOLDER=$dir; done ./DRAWEXE -v -c testdiff $RESULTS_SUBFOLDER $RESULTS_LINUX_GCC_SUBFOLDER