-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configuration - Refactor workflow to use PowerShell for fetching late…
…st run ID and update artifact paths
- Loading branch information
Showing
1 changed file
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
|
@@ -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/[email protected] | ||
|
@@ -632,13 +630,15 @@ jobs: | |
uses: actions/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
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/[email protected] | ||
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 | ||
|