spmx
Guides

Continuous integration

Reuse the store between CI jobs, or bypass spmx when you need a vanilla build.

spmx is useful in CI whenever jobs run on the same machine or restore a cache between runs.

Cache the store

Point the store at a directory your CI can save and restore, and install spmx in the job:

export SPMX_STORE_DIR="$HOME/spmx-store"     # restore this directory from your CI cache
curl -fsSL https://raw.githubusercontent.com/LuisRibeiroo/spmx/main/scripts/install.sh | sh -s -- --no-modify-path
export PATH="$HOME/.spmx/shims:$HOME/.spmx/bin:$PATH"

xcodebuild -workspace App.xcworkspace -scheme App build

The store and the workspace must be on the same APFS volume for zero-copy clones; on a different volume spmx falls back to copying.

To pin a version, set SPMX_VERSION, for example SPMX_VERSION=v0.1.0.

Explicit source package paths

If a job passes -clonedSourcePackagesDirPath to xcodebuild, spmx leaves that directory alone. Use spmx hydrate --source-packages <dir> before the build if you want the store to fill it.

Opting out

SPMX_DISABLE=1 xcodebuild ...            # no shim behavior at all
SPMX_NO_COMPILE_CACHE=1 xcodebuild ...   # hydrate, but no compilation cache

spmx collects no telemetry and makes no network calls of its own, so it needs no network allowance in a locked-down runner.

Maintained by LuisRibeirooLast updated Edit this page on GitHub