Skip to content

Fix for actions

Fix for actions #6

Workflow file for this run

name: CI
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
embree_url: https://github.com/embree/embree/releases/download/v4.3.3/embree-4.3.3.x64.windows.zip
embree_dir: embree-4.3.3.x64.windows
- os: macos-latest
embree_url: https://github.com/embree/embree/releases/download/v4.3.3/embree-4.3.3.x86_64.macosx.zip
embree_dir: embree-4.3.3.x86_64.macosx
runs-on: ${{ matrix.os }}
env:
ARCHFLAGS: "-arch arm64"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install embree
- name: Install OIDN (macOS)
if: runner.os == 'macOS'
run: |
# Download and extract OIDN for macOS (v2.3.3 from RenderKit)
# GitHub macOS runners are ARM64-based, so we need ARM64 version
echo "Downloading OIDN for ARM64..."
wget -O oidn.tar.gz https://github.com/RenderKit/oidn/releases/download/v2.3.3/oidn-2.3.3.arm64.macos.tar.gz
echo "Extracting OIDN..."
mkdir -p oidn_temp && tar -xzf oidn.tar.gz -C oidn_temp
echo "OIDN extraction contents:"
find oidn_temp -type f -name "*.dylib" | head -10
echo "Moving OIDN files..."
# Try different extraction structures
if [ -d "oidn_temp/lib" ]; then
cp -r oidn_temp/* thirdparty/oidn/
elif [ -d "oidn_temp/oidn-2.3.3.arm64.macos" ]; then
cp -r oidn_temp/oidn-2.3.3.arm64.macos/* thirdparty/oidn/
else
echo "Unknown OIDN extraction structure, copying everything"
cp -r oidn_temp/* thirdparty/oidn/ 2>/dev/null || true
fi
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
# Download and extract Embree
Invoke-WebRequest -Uri "${{ matrix.embree_url }}" -OutFile "embree.zip"
Expand-Archive -Path "embree.zip" -DestinationPath "."
$embreePath = "${{ matrix.embree_dir }}"
# Add to PATH for CMake to find it
echo "$PWD/$embreePath/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
echo "EMBREE_LOCATION=$PWD/$embreePath" | Out-File -FilePath $env:GITHUB_ENV -Append
# Download and extract OIDN for Windows (v2.3.3 from RenderKit)
Invoke-WebRequest -Uri "https://github.com/RenderKit/oidn/releases/download/v2.3.3/oidn-2.3.3.x64.windows.zip" -OutFile "oidn.zip"
Expand-Archive -Path "oidn.zip" -DestinationPath "."
Get-ChildItem -Path "." -Name
# Try different extraction structures
if (Test-Path "oidn-2.3.3.x64.windows") {
Move-Item -Path "oidn-2.3.3.x64.windows/*" -Destination "thirdparty/oidn/" -Force
} else {
# Copy whatever was extracted
Get-ChildItem -Path "." | Where-Object { $_.Name -notlike "*.zip" -and $_.Name -notlike "embree*" } | ForEach-Object {
Copy-Item -Path $_.FullName -Destination "thirdparty/oidn/" -Recurse -Force
}
}
- name: Verify OIDN installation
run: |
echo "Checking OIDN installation..."
ls -la thirdparty/oidn/
if [ -d "thirdparty/oidn/lib" ]; then
echo "OIDN lib directory found"
ls -la thirdparty/oidn/lib/
else
echo "OIDN lib directory NOT found!"
exit 1
fi
if [ -d "thirdparty/oidn/include" ]; then
echo "OIDN include directory found"
else
echo "OIDN include directory NOT found!"
exit 1
fi
- name: Prepare library directory
run: |
echo "Ensuring bin/lib directory exists..."
mkdir -p bin/lib
echo "Library directory contents:"
ls -la bin/lib/ || true
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0
- name: Build dependencies
run: |
cd build
cmake --build . --config Release --parallel --target etx-core etx-render etx-rt etx-util
- name: Check library architectures
if: runner.os == 'macOS'
run: |
echo "Checking library architectures..."
find build -name "*.a" -o -name "*.dylib" | head -10 | xargs file 2>/dev/null | head -10 || echo "No libraries found yet"
echo "Checking Embree architecture..."
file /opt/homebrew/lib/libembree4.dylib 2>/dev/null || echo "Embree not found"
- name: Build raytracer
run: |
cd build
cmake --build . --config Release --target raytracer --verbose
- name: Build raytracer executable
run: |
cd build
cmake --build . --config Release --target raytracer
- name: Verify build artifacts (macOS)
if: runner.os == 'macOS'
run: |
cd build
echo "Checking for raytracer executable..."
ls -la ../bin/
if [ -f "../bin/raytracer" ]; then
echo "Found raytracer executable"
file ../bin/raytracer
elif [ -f "raytracer" ]; then
echo "Found raytracer in build directory"
file raytracer
else
echo "Raytracer executable not found in expected locations"
echo "Checking build directory contents:"
find . -name "*raytracer*" 2>/dev/null || echo "No raytracer files found"
exit 1
fi
- name: Verify build artifacts (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
cd build
Write-Host "Checking for raytracer executable..."
Get-ChildItem "../bin/"
if (Test-Path "../bin/raytracer.exe") {
Write-Host "Found raytracer.exe"
} elseif (Test-Path "raytracer.exe") {
Write-Host "Found raytracer.exe in build directory"
} else {
Write-Host "Raytracer executable not found in expected locations"
Get-ChildItem -Recurse -Filter "*raytracer*" | Select-Object FullName
throw "raytracer.exe not found"
}