feat: Integrates Upstream Sync & Fork Protection #1
Workflow file for this run
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: Downstream Integration Test | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-swiftlm-umbrella: | |
| name: Test with SwiftLM (Umbrella Repo) | |
| # This job simulates checking out the parent repo (SwiftLM) and testing | |
| # the integration with the current submodule PR directly. | |
| runs-on: macos-15 | |
| timeout-minutes: 40 | |
| steps: | |
| - name: Checkout SwiftLM (Parent Repo) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: SharpAI/SwiftLM | |
| submodules: recursive | |
| - name: Inject PR Head into Submodule | |
| run: | | |
| # The parent SwiftLM repo likely holds this repository internally (e.g. at packages/mlx-swift or LocalPackages/mlx-swift) | |
| # We check out the PR's exact commit inside the submodule to see if it breaks the parent | |
| cd mlx-swift || cd LocalPackages/mlx-swift | |
| git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-test | |
| git checkout pr-test | |
| - name: Install Metal Toolchain | |
| run: xcodebuild -downloadComponent MetalToolchain || true | |
| - name: Run Parent Benchmarks / Tests | |
| run: | | |
| # Running the integration tests inside the umbrella repo to guarantee | |
| # no custom metal optimizations are wiped by the `mlx-swift` PR merge! | |
| cd $GITHUB_WORKSPACE | |
| # Force a clean resolve | |
| swift package resolve | |
| # Either trigger standard swift tests or the profile benchmark harness | |
| swift test -c release || echo "Failures found in downstream integration!" && exit 1 |