From 453e9043f3cd1526be9bb324d69bd4f3476cf404 Mon Sep 17 00:00:00 2001 From: David Koski Date: Mon, 10 Nov 2025 12:55:51 -0800 Subject: [PATCH] switch to github actions --- .github/ISSUE_TEMPLATE/bug_report.md | 29 ++++++++++++++ .github/pull_request_template.md | 12 ++++++ .github/workflows/pull_request.yml | 56 ++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..75520f36 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Create a report about an issue you've encountered +title: "[BUG] " +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** + +Include code snippet +```swift + +``` + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Desktop (please complete the following information):** + - OS Version: [e.g. MacOS 14.1.2] + - Device: [e.g. iPhone 16, M2 MacBook Pro] + - Version [e.g. 0.29.1] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..02bb9b79 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## Proposed changes + +Please include a description of the problem or feature this PR is addressing. If there is a corresponding issue, include the issue #. + +## Checklist + +Put an `x` in the boxes that apply. + +- [ ] I have read the [CONTRIBUTING](https://github.com/ml-explore/mlx/blob/main/CONTRIBUTING.md) document +- [ ] I have run `pre-commit run --all-files` to format my code / installed pre-commit prior to committing changes +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have updated the necessary documentation (if needed) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 00000000..3a843f34 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,56 @@ +name: Build and Test + +on: pull_request + +permissions: + contents: read + +jobs: + mac_build_and_test: + if: github.repository == 'ml-explore/mlx-swift-lm' + runs-on: [self-hosted, macos] + steps: + - uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Verify MetalToolchain installed + shell: bash + run: xcodebuild -showComponent MetalToolchain + + - name: Setup uv + uses: astral-sh/setup-uv@v6 + with: + python-version: ${{ inputs.python-version }} + activate-environment: true + + - name: Setup swift-format + shell: sh + run: | + uv pip install pre-commit + brew install swift-format + + - name: Run style checks + shell: sh + run: | + pre-commit run --all || (echo "Style checks failed, please install pre-commit and run pre-commit run --all and push the change"; echo ""; git --no-pager diff; exit 1) + + - name: Build Package (Xcode, macOS) + shell: sh + run: | + xcodebuild -version + xcrun --show-sdk-build-version + swift --version + rm -rf ~/Library/Developer/Xcode/DerivedData/* + xcodebuild build-for-testing -scheme mlx-libraries-Package -destination 'platform=macOS' + + - name: Build tools (Xcode, macOS) + shell: sh + run: | + xcodebuild -version + xcrun --show-sdk-build-version + swift --version + find . -name Package.resolved -exec rm {} \; + xcodebuild -scheme llm-tool + xcodebuild -scheme image-tool + xcodebuild -scheme mnist-tool