Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 33 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,51 @@ on:
workflow_dispatch: # Allows manual triggering from GitHub UI

jobs:
build:
name: Build on ${{ matrix.os }}
build-windows:
name: Build on Windows (${{ matrix.config }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config: [Debug, Release]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Build with MSBuild
run: msbuild Examples.sln /p:Configuration=${{ matrix.config }} /p:Platform=x64

- name: Build successful
run: echo "Build completed successfully on Windows (${{ matrix.config }}, all examples)"

build-unix:
name: Build ${{ matrix.example }} on ${{ matrix.os }} (${{ matrix.config }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest]
example: [Simple, Mandelbrot, Minesweeper]

config: [Debug, Release]

steps:
- name: Checkout code
uses: actions/checkout@v4

# Windows Build
- name: Setup MSBuild (Windows)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2

- name: Build with MSBuild (Windows)
if: runner.os == 'Windows'
run: msbuild Examples.sln /p:Configuration=Release /p:Platform=x64


# macOS Build
- name: Build with Clang (macOS)
if: runner.os == 'macOS'
run: |
clang++ -std=c++17 -O2 \
clang++ -std=c++17 ${{ matrix.config == 'Debug' && '-g -O0' || '-O2' }} \
-framework Cocoa -framework Metal -framework QuartzCore \
-I. \
Examples/${{ matrix.example }}/main.cpp \
-o ${{ matrix.example }}

# Linux Build
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
Expand All @@ -49,15 +62,15 @@ jobs:
libx11-dev \
libgl1-mesa-dev \
libglu1-mesa-dev

- name: Build with GCC (Linux)
if: runner.os == 'Linux'
run: |
g++ -std=c++17 -O2 \
g++ -std=c++17 ${{ matrix.config == 'Debug' && '-g -O0' || '-O2' }} \
-I. \
Examples/${{ matrix.example }}/main.cpp \
-lX11 -lGL -lpthread -ldl \
-o ${{ matrix.example }}

- name: Build successful
run: echo "Build completed successfully for ${{ matrix.example }} on ${{ runner.os }}"
run: echo "Build completed successfully for ${{ matrix.example }} on ${{ runner.os }} (${{ matrix.config }})"