Configuration - Update CMake to work with default packages #31
Workflow file for this run
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
# This workflow builds and tests OCCT on multiple platforms (Windows, macOS, Linux with Clang, and Linux with GCC). | |
# It is triggered on pull requests to any branch. | |
# The workflow includes steps to prepare and build the project on each platform, run tests, and upload the results. | |
# Concurrency is set to ensure that only one instance of the workflow runs per pull request at a time. | |
name: Build and Test OCCT on Multiple Platforms | |
on: | |
pull_request: | |
branches: | |
- '**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
test-windows-x64: | |
name: Test on Windows (x64) | |
runs-on: windows-2022 | |
steps: | |
- 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 }}" | |
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" | |
echo "latest_run_id=$latest_run_id" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
shell: pwsh | |
- name: Download test results from target branch | |
uses: actions/[email protected] | |
with: | |
name: results-windows-x64 | |
path: install/results-target | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ steps.get_run_id.outputs.latest_run_id }} | |
- name: Compare test results | |
run: | | |
cd install | |
dir /S | |
for /d %%i in (results\*) do set RESULTS_SUBFOLDER=%%i | |
for /d %%j in (results-target\*) do set RESULTS_WINDOWS_SUBFOLDER=%%j | |
echo %RESULTS_SUBFOLDER% | |
echo %RESULTS_WINDOWS_SUBFOLDER% | |
shell: cmd | |
test-linux-clang-x64: | |
name: Test on Linux with Clang (x64) | |
runs-on: ubuntu-24.04 | |
steps: | |
- 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 | |
- name: Download test results from target branch | |
uses: actions/[email protected] | |
with: | |
name: results-linux-clang-x64 | |
path: install/bin/results-target | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ env.latest_run_id }} | |
- name: Compare test results | |
run: | | |
cd install | |
cd bin | |
for dir in results/*; do export RESULTS_SUBFOLDER=$dir; done | |
for dir in results-target/*; do export RESULTS_LINUX_CLANG_SUBFOLDER=$dir; done | |
echo $RESULTS_SUBFOLDER | |
echo $RESULTS_LINUX_CLANG_SUBFOLDER | |
shell: bash |