Skip to content

ci: add multi-arch CI with baked-ROCm images for 2 new distros (so far) #722

ci: add multi-arch CI with baked-ROCm images for 2 new distros (so far)

ci: add multi-arch CI with baked-ROCm images for 2 new distros (so far) #722

name: Build Applications VS
on:
push:
branches: [ amd-staging, amd-mainline, release/** ]
paths:
- 'Applications/**'
- '.github/workflows/**'
- 'Scripts/VisualStudio/**'
pull_request:
branches: [ amd-staging, amd-mainline, release/** ]
paths:
- 'Applications/**'
- '.github/workflows/**'
- 'Scripts/VisualStudio/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
HIPSDK_INSTALLER_VERSION: 25.Q3
GLFW_DIR: C:\glfw-3.4.bin.WIN64\
jobs:
build:
name: "Build Applications VS"
strategy:
matrix:
config: [Debug, Release]
runs-on: windows-2022
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Install Python dependencies
run: |
python3 -m pip install rich
- name: Check GUID
run: |
python3 Scripts/VisualStudio/check_vs_files.py
- name: Install additional dependencies
run: |
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading GLFW 3.4"
Invoke-WebRequest -Uri https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.bin.WIN64.zip -OutFile glfw-3.4.bin.WIN64.zip
Expand-Archive -Path glfw-3.4.bin.WIN64.zip -DestinationPath C:\ -PassThru
- name: Install HIP SDK
run: |
$ProgressPreference = 'SilentlyContinue'
Write-Host "Downloading installer https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-Win10-Win11-For-HIP.exe"
Invoke-WebRequest -Uri https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-Win10-Win11-For-HIP.exe -OutFile HIPSDK.exe
Write-Host "Installing HIP SDK"
Start-Process HIPSDK.exe -ArgumentList '-install','-log',"$((Get-Location).Path)\installer_log.txt" -NoNewWindow -Wait
Write-Host "Installer log:"
Get-Content "installer_log.txt"
$hip_path = [System.Environment]::GetEnvironmentVariable('HIP_PATH', 'Machine')
if (Test-Path -Path "$hip_path") {
Write-Host "HIP_PATH directory exists: $hip_path"
Write-Host "HIP SDK installed successfully"
} else {
Write-Host "HIP_PATH directory DOES NOT exist: $hip_path"
Write-Host "HIP SDK installation failed"
Exit 1
}
$version = (Split-Path $hip_path -Leaf)
Write-Host "Detected HIP SDK version: $version"
echo "HIP_PATH=$hip_path" >> $env:GITHUB_ENV
echo "PLATFORM_TOOLSET_VERSION=$version" >> $env:GITHUB_ENV
- name: Build ${{ matrix.config }} x64
run: |
Write-Host "Replace toolset $((Get-ChildItem -Recurse -File | Get-Content | Select-String -Pattern 'HIP clang .\..' | Select-Object -First 1).Matches.Value) with HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}"
Get-ChildItem -Recurse -File | Where-Object { Select-String -Pattern 'HIP clang .\..' -Path $_ } | ForEach-Object {
(Get-Content -Path $_.FullName) -replace 'HIP clang .\..', "HIP clang ${{ env.PLATFORM_TOOLSET_VERSION }}" | Set-Content -Path $_.FullName
}
msbuild Scripts\VisualStudio\build.proj -maxCpuCount -detailedSummary -property:"Category=Applications;Configuration=${{ matrix.config }};Platform=x64"
Write-Host "msbuild returned: $LastExitCode"
Exit $LastExitCode