mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-30 07:40:26 +08:00
fix: ci
This commit is contained in:
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@@ -54,7 +54,13 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
cmake_extra_args: -DCMAKE_INSTALL_PREFIX=/usr/local
|
||||||
|
install_cmd: sudo cmake --install level-zero-build && sudo ldconfig
|
||||||
|
- os: windows-latest
|
||||||
|
cmake_extra_args: ""
|
||||||
|
install_cmd: 'for dll in $(find level-zero-build -name "*.dll"); do cp "$dll" /c/Windows/System32/; done'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -62,44 +68,26 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
- name: Install Intel Level Zero (Linux)
|
- name: Download Intel Level Zero Source Code
|
||||||
if: runner.os == 'Linux'
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# The apt runtime package (libze1) does NOT ship libze_null.so, which is
|
# The apt runtime package (libze1) does NOT ship libze_null, which is
|
||||||
# required for ZE_ENABLE_NULL_DRIVER=1. Build from source instead so the
|
# required for ZE_ENABLE_NULL_DRIVER=1. Build from source instead so the
|
||||||
# loader and the null driver are both present, matching the Windows approach.
|
# loader and the null driver are both present
|
||||||
RELEASE=$(curl -sf https://api.github.com/repos/oneapi-src/level-zero/releases/latest \
|
RELEASE=$(curl -sf https://api.github.com/repos/oneapi-src/level-zero/releases/latest \
|
||||||
| jq -r '.tag_name')
|
| jq -r '.tag_name')
|
||||||
git clone https://github.com/oneapi-src/level-zero.git --depth=1 \
|
git clone https://github.com/oneapi-src/level-zero.git --depth=1 \
|
||||||
--branch "$RELEASE" level-zero-src
|
--branch "$RELEASE" level-zero-src
|
||||||
|
|
||||||
|
- name: Build & Install Intel Level Zero
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
cmake -S level-zero-src -B level-zero-build \
|
cmake -S level-zero-src -B level-zero-build \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
-DBUILD_TESTING=OFF \
|
||||||
-DBUILD_TESTING=OFF
|
${{ matrix.cmake_extra_args }}
|
||||||
cmake --build level-zero-build --parallel
|
|
||||||
sudo cmake --install level-zero-build
|
|
||||||
sudo ldconfig
|
|
||||||
|
|
||||||
- name: Install Intel Level Zero (Windows)
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
# The win-sdk zip only contains headers + import .lib files, no runtime DLLs.
|
|
||||||
# Build ze_loader.dll / ze_null.dll from source using the bundled MSVC toolchain.
|
|
||||||
$release = Invoke-RestMethod "https://api.github.com/repos/oneapi-src/level-zero/releases/latest"
|
|
||||||
$tag = $release.tag_name
|
|
||||||
Write-Host "Building level-zero $tag from source"
|
|
||||||
git clone https://github.com/oneapi-src/level-zero.git --depth=1 --branch $tag level-zero-src
|
|
||||||
cmake -S level-zero-src -B level-zero-build `
|
|
||||||
-DCMAKE_BUILD_TYPE=Release `
|
|
||||||
-DBUILD_TESTING=OFF
|
|
||||||
cmake --build level-zero-build --config Release --parallel
|
cmake --build level-zero-build --config Release --parallel
|
||||||
# Install all produced DLLs (ze_loader, ze_null, ze_validation_layer, ze_tracing_layer)
|
${{ matrix.install_cmd }}
|
||||||
$dlls = Get-ChildItem -Recurse -Filter "*.dll" -Path level-zero-build
|
|
||||||
foreach ($dll in $dlls) {
|
|
||||||
Copy-Item $dll.FullName "$env:SystemRoot\System32\" -Force
|
|
||||||
Write-Host "Installed $($dll.Name) to System32"
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Run examples
|
- name: Run examples
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user