Skip to content

Split OpenCL program tests by API #81

Split OpenCL program tests by API

Split OpenCL program tests by API #81

Workflow file for this run

name: Test
defaults:
run:
shell: bash
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unit-tests:
name: Unit Tests (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: windows-x64
os: windows-2022
node_arch: x64
native_tests: true
- target: windows-arm64
os: windows-11-arm
node_arch: arm64
native_tests: true
- target: linux-x64
os: ubuntu-22.04
node_arch: x64
native_tests: true
- target: linux-arm64
os: ubuntu-22.04-arm
node_arch: arm64
native_tests: true
- target: darwin-x64
os: macos-26
node_arch: x64
native_tests: false
- target: darwin-arm64
os: macos-26
node_arch: arm64
native_tests: false
runs-on: ${{ matrix.os }}
steps:
- name: Fetch Repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 24.13.0
architecture: ${{ matrix.node_arch }}
cache: 'npm'
- name: Install Modules
run: npm ci
- name: Install OpenCL - Ubuntu ARM
if: matrix.target == 'linux-arm64'
run: |
sudo apt update -qq
sudo apt install -qq ocl-icd-opencl-dev pocl-opencl-icd
- name: Install OpenCL - Windows 1
if: matrix.target == 'windows-x64'
run: |
curl -o opencl-installer.exe 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b6dccdb7-b503-41ea-bd4b-a78e9c2d8dd6/w_opencl_runtime_p_2025.1.0.972.exe'
./opencl-installer.exe --s --x --f ocl
cp "./ocl/w_opencl_runtime_p_2025.1.0.972.msi" "./opencl-rt.msi"
touch install.log
- name: Install OpenCL - Windows 2
shell: pwsh
if: matrix.target == 'windows-x64'
run: |
$file = "opencl-rt.msi"
$log = "install.log"
$procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
$procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru
$procMain.WaitForExit()
$procLog.Kill()
- name: Install OpenCL - Windows ARM
shell: pwsh
if: matrix.target == 'windows-arm64'
run: |
$url = "https://github.com/microsoft/OpenCLOn12/releases/download/v1.2404.1.0/Universal_D3DMappingLayers_1.2404.1.0_arm64.appx"
$file = "opencl-on12-arm64.appx"
Invoke-WebRequest -Uri $url -OutFile $file
Add-AppxPackage -Path $file
Get-AppxPackage Microsoft.D3DMappingLayers | Format-List Name,PackageFullName,Architecture,InstallLocation
foreach ($key in "HKLM:\SOFTWARE\Khronos\OpenCL\Vendors", "HKCU:\SOFTWARE\Khronos\OpenCL\Vendors") {
if (Test-Path $key) {
Get-ItemProperty $key | Format-List
} else {
Write-Host "OpenCL ICD registry key not found: $key"
}
}
- name: Install OpenCL - Ubuntu
if: matrix.target == 'linux-x64'
run: |
# download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update -qq
sudo apt install -qq ocl-icd-opencl-dev intel-oneapi-runtime-opencl
- name: Build Current Binary
run: npm run build:rebuild
- name: Run Unit Tests
if: ${{ matrix.native_tests }}
timeout-minutes: 5
run: npm run test:ci
- name: Run Export Tests
if: ${{ !matrix.native_tests }}
run: node --test "ts/exports.test.ts"