Skip to content

config

config #81

Workflow file for this run

name: build
# Trigger policy:
# - push to main, but skip documentation-only changes
# - any pull request targeting main
# - manual "Run workflow" button (workflow_dispatch)
# Feature-branch pushes intentionally do NOT build, to keep noise down on a
# high-commit repo. Open a PR against main (or trigger manually) to get CI.
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'doc/**'
pull_request:
branches: [ main ]
workflow_dispatch:
# When a newer commit is pushed to the same branch/PR, cancel the in-progress
# run instead of letting both finish.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
env:
# CPM caches fetched dependency sources here; the cache step below
# persists it between runs so heavy deps (Jolt, Geogram, ...) are not
# re-downloaded every time.
CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm_cache
# A step's `shell:` key does not accept ${{ }} expressions (no context,
# including matrix, is available there). Selecting the per-entry shell as
# the job default works because `defaults.run` does allow the matrix
# context, and it applies to every run: step in the job.
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux (Ninja / OpenGL)
os: ubuntu-latest
api: opengl
shell: bash
configure: bash scripts/configure_ninja_linux_opengl.sh
build_dir: build_ninja_linux
config: Release
- name: Linux (Ninja / Vulkan)
os: ubuntu-latest
api: vulkan
shell: bash
configure: bash scripts/configure_ninja_linux_vulkan.sh
build_dir: build_ninja_linux_vulkan
config: Release
- name: macOS (Xcode / Metal)
os: macos-latest
api: metal
shell: bash
configure: bash scripts/configure_xcode_metal.sh
build_dir: build_xcode_metal
config: Debug
- name: macOS (Xcode / OpenGL)
os: macos-latest
api: opengl
shell: bash
configure: bash scripts/configure_xcode_opengl.sh
build_dir: build_xcode_opengl
config: Debug
- name: macOS (Xcode / Vulkan)
os: macos-latest
api: vulkan
shell: bash
configure: bash scripts/configure_xcode_vulkan.sh
build_dir: build_xcode_vulkan
config: Debug
# Visual Studio 2026 is preinstalled on the "windows-2025-vs2026"
# runner label (see actions/runner-images#14017). During the
# 2026-06-08..06-15 rollout it also becomes the default for
# "windows-latest" / "windows-2025"; once that completes (and the
# explicit "windows-2025-vs2026" label is eventually retired), switch
# the os lines below to "windows-latest".
- name: Windows (VS 2026 / OpenGL)
os: windows-2025-vs2026
api: opengl
shell: cmd
configure: call scripts\configure_vs2026_opengl.bat
build_dir: build_vs2026_opengl
config: Debug
- name: Windows (VS 2026 / Vulkan)
os: windows-2025-vs2026
api: vulkan
shell: cmd
configure: call scripts\configure_vs2026_vulkan.bat
build_dir: build_vs2026_vulkan
config: Debug
- name: Windows (VS 2026 / headless)
os: windows-2025-vs2026
api: none
shell: cmd
configure: call scripts\configure_vs2026_headless.bat
build_dir: build_vs2026_headless
config: Debug
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache CPM dependencies
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cpm_cache
key: cpm-${{ matrix.os }}-${{ matrix.api }}-${{ hashFiles('cmake/**', '**/CMakeLists.txt') }}
restore-keys: |
cpm-${{ matrix.os }}-${{ matrix.api }}-
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libwayland-dev libxkbcommon-dev xorg-dev libtbb-dev
- name: Configure
run: ${{ matrix.configure }}
- name: Build editor
run: cmake --build "${{ matrix.build_dir }}" --target editor --config "${{ matrix.config }}" --parallel
# Android / Meta Quest build. Kept separate from the matrix above because it
# is Gradle-driven (gradlew -> Android Gradle Plugin -> erhe's top-level
# CMake via externalNativeBuild on the NDK), which does not fit the
# cmake-configure + cmake-build steps the matrix jobs share. Builds the APK
# only; running on a headset needs physical hardware (a self-hosted runner).
build-quest:
name: Android (Quest / Vulkan + OpenXR)
runs-on: ubuntu-latest
timeout-minutes: 120
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/.cpm_cache
steps:
- name: Checkout
uses: actions/checkout@v4
# Gradle 8.12 (the pinned wrapper) does not support JDK 25; AGP 8.7.3
# needs JDK 17+. JDK 21 matches the local toolchain (Android Studio JBR).
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Set up Android SDK
uses: android-actions/setup-android@v3
# NDK version is pinned in android-project/app/build.gradle; CMake 3.22.1
# is AGP 8.7.3's default and satisfies erhe's 3.16.3 floor.
- name: Install NDK, CMake and platform
run: |
yes | sdkmanager --licenses > /dev/null || true
sdkmanager "platforms;android-35" "build-tools;35.0.0" "ndk;28.2.13676358" "cmake;3.22.1"
- name: Cache CPM dependencies
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cpm_cache
key: cpm-android-quest-${{ hashFiles('cmake/**', '**/CMakeLists.txt') }}
restore-keys: |
cpm-android-quest-
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-quest-${{ hashFiles('android-project/**/*.gradle', 'android-project/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
gradle-quest-
# -PpythonExecutable avoids the Windows-only `py -3` probe in
# app/build.gradle (which would fall back to CMake's Python detection).
# The committed gradlew has no exec bit in git, so set it here.
- name: Build Quest APK (assembleQuestDebug)
working-directory: android-project
run: |
chmod +x ./gradlew
./gradlew -p . --no-daemon --console=plain -PpythonExecutable=$(which python3) assembleQuestDebug
- name: Upload Quest APK
uses: actions/upload-artifact@v4
with:
name: erhe-quest-debug-apk
path: android-project/app/build/outputs/apk/quest/debug/app-quest-debug.apk
if-no-files-found: error