chore: add Dependabot for SwiftPM and Actions (#5) #12
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Show Swift version | |
| run: swift --version | |
| # mlx-swift's Metal shaders + the MLX C++ sources are expensive to | |
| # compile; cache the SwiftPM and Xcode build products across runs. | |
| - name: Cache build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .build | |
| ~/Library/Caches/org.swift.swiftpm | |
| key: ${{ runner.os }}-build-${{ hashFiles('Package.swift') }} | |
| restore-keys: ${{ runner.os }}-build- | |
| # xcodebuild (not `swift build`) compiles the Metal shaders, so this | |
| # verifies the artifact users actually run. -skipMacroValidation is | |
| # required for the MLXHuggingFace macro plugin in non-interactive runs. | |
| - name: Build (xcodebuild — compiles Metal shaders) | |
| run: | | |
| xcodebuild -scheme mlx-server \ | |
| -destination 'platform=macOS' \ | |
| -configuration Debug \ | |
| -derivedDataPath .build/xcode \ | |
| -skipMacroValidation \ | |
| build | |
| # The test suite is model-free (no GPU / no weights), so SwiftPM runs | |
| # it directly and fast. | |
| - name: Test | |
| run: swift test |