ci: resolve merge conflict - keep submodules:recursive and pre-instal… #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SwiftLM Integration Tests | |
| on: [pull_request, push] | |
| jobs: | |
| integration-test: | |
| name: Build & Test SwiftLM | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout mlx-swift (this repository) | |
| uses: actions/checkout@v4 | |
| with: | |
| path: mlx-swift | |
| submodules: recursive | |
| - name: Checkout SwiftLM | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: SharpAI/SwiftLM | |
| path: SwiftLM | |
| submodules: recursive | |
| - name: Redirect Dependencies to Local Form | |
| run: | | |
| # Point SwiftLM to the local checkout of mlx-swift PR branch | |
| sed -i '' -E 's|\.package\(url: "https://github.com/SharpAI/mlx-swift\.git".*|\.package(path: "../mlx-swift"),|' SwiftLM/Package.swift | |
| sed -i '' -E 's|\.package\(url: "https://github.com/ml-explore/mlx-swift\.git".*|\.package(path: "../mlx-swift"),|' SwiftLM/Package.swift | |
| # Point the inner mlx-swift-lm submodule to the local checkout of mlx-swift PR branch | |
| sed -i '' -E 's|\.package\(url: "https://github.com/SharpAI/mlx-swift\.git".*|\.package(path: "../../mlx-swift"),|' SwiftLM/mlx-swift-lm/Package.swift | |
| sed -i '' -E 's|\.package\(url: "https://github.com/ml-explore/mlx-swift\.git".*|\.package(path: "../../mlx-swift"),|' SwiftLM/mlx-swift-lm/Package.swift | |
| - name: Build SwiftLM | |
| run: | | |
| cd SwiftLM | |
| swift build -c release | |
| - name: Install MLX Metal library | |
| run: | | |
| python3 -m venv /tmp/mlx_venv | |
| /tmp/mlx_venv/bin/pip install --quiet mlx | |
| MLX_LIB=$(find /tmp/mlx_venv -name "mlx.metallib" | head -n 1) | |
| echo "Copying metallib from $MLX_LIB" | |
| # Next to the release binary so the server process finds it immediately | |
| cp "$MLX_LIB" SwiftLM/.build/release/ | |
| # Also seed all other build output dirs defensively | |
| find SwiftLM/.build -type d \( -name "debug" -o -name "release" \) \ | |
| -exec cp "$MLX_LIB" {}/ \; 2>/dev/null || true | |
| - name: Run Speculative Decoding Tests | |
| run: | | |
| cd SwiftLM | |
| bash tests/test-speculative-eval.sh |