Skip to content

Commit 70bb815

Browse files
authored
ws--
1 parent eb7a2b3 commit 70bb815

1 file changed

Lines changed: 104 additions & 0 deletions

File tree

build-cache.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Build Actions Cache
2+
3+
on:
4+
workflow_call: # reusable
5+
schedule:
6+
- cron: '0 * * * *'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
ubuntu-24-vulkan-cache:
14+
runs-on: ubuntu-24.04
15+
16+
steps:
17+
- name: Get latest Vulkan SDK version
18+
id: vulkan_sdk_version
19+
run: |
20+
echo "VULKAN_SDK_VERSION=$(curl https://vulkan.lunarg.com/sdk/latest/linux.txt)" >> "$GITHUB_ENV"
21+
22+
- name: Cache Vulkan SDK
23+
id: cache_vulkan_sdk
24+
uses: actions/cache@v4
25+
with:
26+
path: ./vulkan_sdk
27+
key: vulkan-sdk-${{ env.VULKAN_SDK_VERSION }}-${{ runner.os }}
28+
29+
- name: Install Vulkan SDK
30+
if: steps.cache_vulkan_sdk.outputs.cache-hit != 'true'
31+
id: vulkan_sdk_install
32+
run: |
33+
mkdir -p vulkan_sdk
34+
cd vulkan_sdk
35+
curl --no-progress-meter https://sdk.lunarg.com/sdk/download/latest/linux/vulkan_sdk.tar.xz | tar -Jx --strip-components=1
36+
37+
ubuntu-24-spacemit-cache:
38+
runs-on: ubuntu-24.04
39+
40+
env:
41+
SPACEMIT_IME_TOOLCHAIN_VERSION: "1.1.2"
42+
43+
steps:
44+
- name: Cache SpacemiT Toolchain
45+
uses: actions/cache@v4
46+
id: cache-spacemit-ime-cross-toolchain
47+
with:
48+
path: ./spacemit-toolchain
49+
key: spacemit-ime-toolchain-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}-${{ runner.os }}
50+
51+
- name: Setup SpacemiT Toolchain
52+
if: steps.cache-spacemit-ime-cross-toolchain.outputs.cache-hit != 'true'
53+
run: |
54+
mkdir -p spacemit-toolchain
55+
cd spacemit-toolchain
56+
curl --no-progress-meter https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v${{ env.SPACEMIT_IME_TOOLCHAIN_VERSION }}.tar.xz | tar -Jx --strip-components=1
57+
58+
windows-2022-rocm-cache:
59+
runs-on: windows-2022
60+
61+
env:
62+
# The ROCm version must correspond to the version used in the HIP SDK.
63+
ROCM_VERSION: "6.4.2"
64+
HIPSDK_INSTALLER_VERSION: "25.Q3"
65+
66+
steps:
67+
- name: Cache ROCm Installation
68+
id: cache-rocm
69+
uses: actions/cache@v4
70+
with:
71+
path: C:\Program Files\AMD\ROCm
72+
key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
73+
74+
- name: Install ROCm
75+
if: steps.cache-rocm.outputs.cache-hit != 'true'
76+
id: depends
77+
run: |
78+
$ErrorActionPreference = "Stop"
79+
write-host "Downloading AMD HIP SDK Installer"
80+
Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
81+
write-host "Installing AMD HIP SDK"
82+
$proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
83+
$completed = $proc.WaitForExit(600000)
84+
if (-not $completed) {
85+
Write-Error "ROCm installation timed out after 10 minutes. Killing the process"
86+
$proc.Kill()
87+
exit 1
88+
}
89+
if ($proc.ExitCode -ne 0) {
90+
Write-Error "ROCm installation failed with exit code $($proc.ExitCode)"
91+
exit 1
92+
}
93+
write-host "Completed AMD HIP SDK installation"
94+
95+
- name: Verify ROCm
96+
id: verify
97+
run: |
98+
# Find and test ROCm installation
99+
$clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
100+
if (-not $clangPath) {
101+
Write-Error "ROCm installation not found"
102+
exit 1
103+
}
104+
& $clangPath.FullName --version

0 commit comments

Comments
 (0)