Build Windows Packages #75
This file contains hidden or 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
name: Build Windows Packages | |
on: | |
workflow_dispatch: | |
inputs: | |
package_version: | |
type: string | |
default: ADHOCBUILD | |
amdgpu_families: | |
type: string | |
workflow_call: | |
inputs: | |
package_version: | |
type: string | |
default: ADHOCBUILD | |
amdgpu_families: | |
type: string | |
jobs: | |
build_windows_packages: | |
name: Build Windows Packages | |
runs-on: azure-windows-scale-rocm | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: true | |
env: | |
BASE_BUILD_DIR_POWERSHELL: C:\mnt\azure\b | |
CACHE_DIR: ${{ github.workspace }}/.cache | |
CCACHE_DIR: "${{ github.workspace }}/.cache/ccache" | |
CCACHE_MAXSIZE: "700M" | |
steps: | |
- name: "Create build dir" | |
shell: powershell | |
run: | | |
$currentTime = (Get-Date).ToString('HHmmss') | |
$buildDir = "$env:BASE_BUILD_DIR_POWERSHELL\$currentTime" | |
echo "BUILD_DIR_POWERSHELL=$buildDir" >> $env:GITHUB_ENV | |
mkdir "$buildDir" | |
Write-Host "Generated Build Directory: $buildDir" | |
$bashBuildDir = $buildDir -replace '\\', '/' -replace '^C:', '/c' | |
echo "BUILD_DIR_BASH=$bashBuildDir" >> $env:GITHUB_ENV | |
Write-Host "Converted Build Directory For Bash: $bashBuildDir" | |
- name: "Checking out repository" | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | |
with: | |
python-version: "3.12" | |
- name: Install requirements | |
run: | | |
choco install ccache --yes | |
choco install ninja --yes | |
- name: Runner Health Settings | |
run: | | |
echo "CCACHE_DIR=${CCACHE_DIR}" | |
df -h | |
ccache -z | |
mkdir -p $CCACHE_DIR | |
cmake --version | |
echo "python: $(which python), python3: $(which python3)" | |
echo "Git version: $(git --version)" | |
git config fetch.parallel 10 | |
git config --global user.email "nobody@amd.com" | |
git config --global user.name "Nobody" | |
# TODO: We shouldn't be using a cache on actual release branches, but it | |
# really helps for iteration time. | |
- name: Enable cache | |
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
with: | |
path: ${{ env.CACHE_DIR }} | |
key: windows-build-packages-v2-${{ github.sha }} | |
restore-keys: | | |
windows-build-packages-v2- | |
- name: Fetch sources | |
run: | | |
python ./build_tools/fetch_sources.py --jobs 12 | |
- name: Configure MSVC | |
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 | |
- name: Configure Projects | |
run: | | |
# Generate a new build id. | |
package_version="${{ inputs.package_version }}" | |
amdgpu_families="${{ inputs.amdgpu_families }}" | |
echo "Building package ${package_version}" | |
# Build. | |
cmake -B "${{ env.BUILD_DIR_BASH }}" -GNinja . \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded \ | |
-DTHEROCK_AMDGPU_FAMILIES=${amdgpu_families} \ | |
-DTHEROCK_PACKAGE_VERSION="${package_version}" \ | |
-DTHEROCK_ENABLE_COMPILER=ON \ | |
-DTHEROCK_ENABLE_HIPIFY=ON \ | |
-DTHEROCK_ENABLE_CORE=OFF \ | |
-DTHEROCK_ENABLE_CORE_RUNTIME=OFF \ | |
-DTHEROCK_ENABLE_HIP_RUNTIME=OFF \ | |
-DTHEROCK_ENABLE_PROFILER_SDK=OFF \ | |
-DTHEROCK_ENABLE_COMM_LIBS=OFF \ | |
-DTHEROCK_ENABLE_MATH_LIBS=OFF \ | |
-DTHEROCK_ENABLE_RAND=OFF \ | |
-DTHEROCK_ENABLE_PRIM=OFF \ | |
-DTHEROCK_ENABLE_FFT=OFF \ | |
-DTHEROCK_ENABLE_BLAS=OFF \ | |
-DTHEROCK_ENABLE_SPARSE=OFF \ | |
-DTHEROCK_ENABLE_SOLVER=OFF \ | |
-DTHEROCK_ENABLE_ML_LIBS=OFF | |
- name: Build Projects | |
run: cmake --build "${{ env.BUILD_DIR_BASH }}" | |
- name: Report | |
if: ${{ !cancelled() }} | |
run: | | |
echo "Build dir:" | |
echo "------------" | |
ls -lh "${{ env.BUILD_DIR_BASH }}" | |
echo "CCache Stats:" | |
echo "-------------" | |
ccache -s | |
- name: Save cache | |
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2 | |
if: always() | |
with: | |
path: ${{ env.CACHE_DIR }} | |
key: windows-build-packages-v2-${{ github.sha }} | |
- name: "Clean up build dir" | |
if: always() | |
run: if (Test-Path -Path "$Env:BUILD_DIR_POWERSHELL") {Remove-Item -Path "$Env:BUILD_DIR_POWERSHELL" -Recurse -Force} | |
shell: powershell |