Skip to content
Closed
Show file tree
Hide file tree
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
55 changes: 55 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Swift Build (fork)

# Fork-only CI: builds the package (and compiles the tests, without running them)
# on every pushed commit.
#
# This is intentionally a SEPARATE file from pull_request.yml (the workflow shared
# with upstream ml-explore) for two reasons:
# 1. Syncing from upstream never produces a merge conflict on this file.
# 2. The job is gated to this fork via `if: github.repository == ...`, mirroring
# how upstream's jobs are gated to ml-explore. If this file ever reaches the
# upstream repo, the job is simply skipped there -- it can never run or
# interfere upstream.

on:
push:

permissions:
contents: read

# Cancel an in-progress build for a branch when a newer commit is pushed to it,
# so rapid pushes don't pile up (macOS runner minutes are billed at 10x).
concurrency:
group: swift-build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
# Fork-only. Never runs on upstream ml-explore (kept inert if it lands there).
if: github.repository == 'PicoMLX/mlx-swift-lm'
# macOS 15 (Sequoia) hosted runner: provides Xcode + the Metal toolchain
# needed to produce the Metal library that `swift build` alone cannot. Unlike
# the macos-14 image (which tops out at Xcode 15.4 / Swift 5.10), it can run
# Xcode 16.3+ for the Swift 6.1 toolchain that Package.swift requires.
runs-on: macos-15
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

# Package.swift declares swift-tools-version 6.1, so select the newest
# stable Xcode on the image (Swift 6.1+). Without this, package resolution
# fails: "using Swift tools version 6.1.0 but the installed version is 5.10.0".
- name: Select latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Versions
run: |
xcodebuild -version
swift --version

- name: Build for testing (Xcode, macOS)
run: |
xcodebuild build-for-testing -scheme mlx-swift-lm-Package -destination 'platform=macOS'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ pyproject.toml
uv.lock
main.py

# Claude Code agent worktrees (transient, isolated working copies)
.claude/worktrees/

Loading