Skip to content

Add \cancel family (PR 1/2): model, parser, and serialization (#259) #205

Add \cancel family (PR 1/2): model, parser, and serialization (#259)

Add \cancel family (PR 1/2): model, parser, and serialization (#259) #205

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
# Run every step with an explicit bash shell so it gets `-eo pipefail`.
# Without pipefail, `xcodebuild ... | xcpretty` returns xcpretty's exit code
# (0) and silently masks xcodebuild build/test failures.
defaults:
run:
shell: bash
jobs:
build-and-test:
name: Build & Test
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Select Xcode 16.2
run: sudo xcode-select -s /Applications/Xcode_16.2.app
# Pick a concrete, installed iPhone simulator by UDID rather than relying
# on a hard-coded name/OS that may not exist on the runner image. Prefers
# "iPhone 16" but falls back to any available iPhone.
- name: Select an iOS Simulator
id: sim
run: |
UDID=$(xcrun simctl list devices available -j | jq -r '
[.devices[][] | select(.name | test("^iPhone"))]
| (map(select(.name == "iPhone 16")) + .)[0].udid // empty')
if [ -z "$UDID" ]; then
echo "No available iPhone simulator found:"
xcrun simctl list devices available
exit 1
fi
echo "Using simulator $UDID"
# Boot it now so it stays eligible/available across later xcodebuild
# steps (the destination is otherwise occasionally not matched).
xcrun simctl boot "$UDID" || true
echo "udid=$UDID" >> "$GITHUB_OUTPUT"
# ── Swift Package Manager ──────────────────────────────────────────────
- name: SPM build
run: swift build
- name: SPM test
run: swift test
# ── iosMath.xcodeproj (library + XCTest suite, iOS simulator) ──────────
# The iosMathExample app is intentionally not built here. Its legacy
# View.xib (Interface Builder format from ~Xcode 7) deterministically
# crashes ibtoold during CompileXIB on the headless runner (ibtool exits
# non-zero with an empty `com.apple.ibtool.errors` block). It builds fine
# in Xcode and locally, and is buildable on demand via the shared
# `iosMathExample` scheme. The library/header coverage it would add is
# already provided by the XCTest suite below (which imports the public
# render headers) and by the macOS/Swift example app builds.
- name: Xcode test – iOS
run: |
xcodebuild test \
-project iosMath.xcodeproj \
-scheme iosMath \
-destination "id=${{ steps.sim.outputs.udid }}" \
CODE_SIGNING_ALLOWED=NO \
| xcpretty
# ── MacOSMath.xcodeproj (macOS example app — build only, no test target) ─
- name: Xcode build – macOS example
run: |
xcodebuild build \
-project MacOSMath.xcodeproj \
-scheme MacOSMath \
CODE_SIGNING_ALLOWED=NO \
| xcpretty
# ── SwiftMathExample.xcodeproj (Swift example — build only, no test target)
# Only the macOS variant is built here. The iOS variant of this scheme
# consumes iosMath via a local Swift package reference embedded in the
# .xcodeproj; on the headless runner that package graph fails to load for
# the iOS target and xcodebuild reports "Found no destinations for the
# scheme" (the identical command builds fine in Xcode / locally). The
# Swift-interop coverage it would add is already provided by the macOS
# Swift example below (same Swift sources, same library) and by the SPM
# build/test steps, so it is intentionally omitted rather than worked
# around.
- name: Xcode build – Swift example (macOS)
run: |
xcodebuild build \
-project SwiftMathExample.xcodeproj \
-scheme SwiftMathExampleMac \
CODE_SIGNING_ALLOWED=NO \
| xcpretty