Files
IfcOpenShell/.github/workflows/ci-wgpu-mac.yml
T
Dion Moult b103563c8d ci: wgpu mac — disable IfcGeom/CGAL/OCCT; drop ctest -R filter
Two iterations on the first CI run:

1. The top-level cmake/CMakeLists.txt unconditionally find_package's
   CGAL (line 217) and OpenCASCADE (222) before our BUILD_BONSAIVIEWER
   gate kicks in, so configure failed with "Could NOT find CGAL". Pass
   BUILD_IFCGEOM=OFF + BUILD_IFCPYTHON=OFF + BUILD_CONVERT=OFF +
   BUILD_EXAMPLES=OFF + BUILD_GEOMSERVER=OFF + WITH_OPENCASCADE=OFF +
   WITH_CGAL=OFF + COLLADA_SUPPORT=OFF so all the heavy deps stay out
   of the configure step. Verified locally on Linux.

2. The ctest -R "wgpu" filter was case-sensitive and the Catch2 test
   names begin with capital "Wgpu" (e.g. "WgpuSelectionState starts
   empty..."), so it matched zero tests and ctest exited with "No
   tests were found". The standalone wgpu config only builds the
   wgpu tests anyway, so the filter is unnecessary — drop it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 18:03:40 +10:00

116 lines
3.8 KiB
YAML

name: wgpu sanity (macOS)
# Lightweight compile-only check for the wgpu backend on macOS. Skips the
# IfcViewerWgpuMinimal executable (its surface creation has no Metal path
# yet — see task #32) and just confirms IfcViewerWgpu links and the pure-
# CPU state tests pass.
#
# Goal: catch portability regressions in the wgpu source on Apple Silicon
# / Intel Mac without needing the full IfcGeom + OCCT + Python toolchain
# that build_osx.yml carries. Runs in ~5 minutes.
on:
push:
branches:
- ifcviewer-wgpu
- main
- v0.8.0
paths:
- 'src/ifcviewer-wgpu/**'
- 'src/ifcviewer/SidecarCache.*'
- 'src/ifcviewer/InstancedGeometry.h'
- 'src/ifcviewer/VertexQuantization.h'
- 'cmake/CMakeLists.txt'
- '.github/workflows/ci-wgpu-mac.yml'
pull_request:
paths:
- 'src/ifcviewer-wgpu/**'
- 'src/ifcviewer/SidecarCache.*'
- 'src/ifcviewer/InstancedGeometry.h'
- 'src/ifcviewer/VertexQuantization.h'
- 'cmake/CMakeLists.txt'
- '.github/workflows/ci-wgpu-mac.yml'
workflow_dispatch:
jobs:
build_wgpu_mac:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
runner: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
- name: Install dependencies via Homebrew
run: |
brew update
# qt installs Qt6 currently; eigen is header-only.
brew install qt eigen
# patchelf isn't on mac — wgpu-native's SONAME workaround is
# Linux-only and CMake guards on UNIX AND NOT APPLE so this is fine.
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.22
with:
key: mac-wgpu-${{ matrix.arch }}
- name: Configure (standalone wgpu, tests on)
shell: bash
# The top-level CMakeLists.txt unconditionally find_package's
# CGAL/OpenCASCADE/etc. before our BUILD_BONSAIVIEWER gate kicks
# in, so we explicitly disable every IfcGeom/IfcParse/IfcPython
# subproject — we only want IfcViewerWgpu + its state tests.
run: |
QT_PREFIX="$(brew --prefix qt)"
cmake -B build \
-S cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_BONSAIVIEWER=OFF \
-DBUILD_BONSAIVIEWER_WGPU=ON \
-DBUILD_BONSAIVIEWER_TESTS=ON \
-DBUILD_IFCGEOM=OFF \
-DBUILD_IFCPYTHON=OFF \
-DBUILD_CONVERT=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_GEOMSERVER=OFF \
-DWITH_OPENCASCADE=OFF \
-DWITH_CGAL=OFF \
-DCOLLADA_SUPPORT=OFF \
-DCMAKE_PREFIX_PATH="${QT_PREFIX}" \
-DQT_DIR="${QT_PREFIX}" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build IfcViewerWgpu + state tests
# Skip IfcViewerWgpuMinimal: its createSurface has no Metal path
# yet (task #32). Static lib compiles cleanly because the X11 /
# Wayland surface blocks are wrapped in #if defined(Q_OS_LINUX).
run: |
cmake --build build \
--target IfcViewerWgpu test_wgpu_selection test_wgpu_visibility \
-- -j
- name: Run state tests
working-directory: build
# No -R filter: only wgpu state tests are built in this config,
# so ctest discovers exactly those.
run: ctest --output-on-failure
- name: Upload CMake configure log on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: cmake-log-${{ matrix.arch }}
path: |
build/CMakeCache.txt
build/CMakeFiles/CMakeConfigureLog.yaml
retention-days: 14