Skip to content

Make core window tests headless-safe #97

Make core window tests headless-safe

Make core window tests headless-safe #97

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
- target: windows-arm64
os: windows-11-arm
node_arch: arm64
- target: linux-x64
os: ubuntu-22.04
node_arch: x64
- target: linux-arm64
os: ubuntu-22.04-arm
node_arch: arm64
- target: darwin-x64
os: macos-26
node_arch: x64
- target: darwin-arm64
os: macos-26
node_arch: arm64
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: Print Native Target
run: |
echo "runner=$(uname -s)-$(uname -m)"
node -p "'node=' + process.version + ' platform=' + process.platform + ' arch=' + process.arch"
npm config get arch
- name: Install Modules
run: npm ci
- name: Install Mesa Surfaceless EGL - Mac
if: matrix.target == 'darwin-x64' || matrix.target == 'darwin-arm64'
run: bash .github/scripts/setup-macos-gl.sh ${{ matrix.node_arch }}
- name: Install OpenGL Compatibility Pack - 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 = "d3d-mapping-layers-arm64.appx"
Invoke-WebRequest -Uri $url -OutFile $file
Add-AppxPackage -Path $file
Get-AppxPackage Microsoft.D3DMappingLayers | Format-List Name,PackageFullName,Architecture,InstallLocation
- name: Tests - Linux
if: matrix.target == 'linux-x64' || matrix.target == 'linux-arm64'
run: xvfb-run --auto-servernum npm run test:ci
- uses: ssciwr/setup-mesa-dist-win@v3
if: matrix.target == 'windows-x64'
- name: Test - Windows
if: matrix.target == 'windows-x64' || matrix.target == 'windows-arm64'
run: npm run test:ci
- name: Test - Mac
if: matrix.target == 'darwin-x64' || matrix.target == 'darwin-arm64'
run: npm run test:ci
- name: Check Diff Artifacts
id: diff-artifacts
if: always()
run: |
if [ -d test/__diff__ ] && find test/__diff__ -type f | read -r _; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/upload-artifact@v7
if: always() && steps.diff-artifacts.outputs.present == 'true'
with:
name: __diff__-${{ matrix.target }}
path: test/__diff__
retention-days: 1
compression-level: 0
overwrite: true