Skip to content

GitHub actions updated #2

GitHub actions updated

GitHub actions updated #2

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 }}
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)
wget -O oidn.tar.gz https://github.com/RenderKit/oidn/releases/download/v2.3.3/oidn-2.3.3.x86_64.macos.tar.gz
mkdir oidn_temp && tar -xzf oidn.tar.gz -C oidn_temp
mv oidn_temp/* thirdparty/oidn/
- 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 "."
Move-Item -Path "oidn-2.3.3.x64.windows/*" -Destination "thirdparty/oidn/" -Force
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cd build
cmake --build . --config Release --parallel
- 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
if [ ! -f "bin/raytracer" ]; then
echo "raytracer executable not found"
exit 1
fi
# Verify the executable is not corrupted
file bin/raytracer
- name: Verify build artifacts (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
cd build
if (!(Test-Path "bin/raytracer.exe")) {
throw "raytracer.exe not found"
}