Skip to content

Commit 2959af0

Browse files
author
Awni Hannun
authored
switch go github actions (ml-explore#618)
1 parent 8f1f88e commit 2959af0

4 files changed

Lines changed: 98 additions & 100 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Setup macOS Environment'
2+
description: 'Install dependencies for macOS'
3+
4+
inputs:
5+
python-version:
6+
description: 'Python version to use'
7+
required: false
8+
default: '3.10'
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- uses: conda-incubator/setup-miniconda@v3
14+
with:
15+
miniconda-version: "latest"
16+
python-version: ${{ inputs.python-version }}

.github/workflows/pull_request.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/head/main' }}
14+
15+
jobs:
16+
check_lint:
17+
if: github.repository == 'ml-explore/mlx-lm'
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- uses: actions/checkout@v5
21+
- uses: actions/setup-python@v6
22+
with:
23+
python-version: "3.10"
24+
- uses: pre-commit/action@v3.0.1
25+
26+
mac_build_and_test:
27+
if: github.repository == 'ml-explore/mlx-lm'
28+
runs-on: [self-hosted, macos]
29+
needs: check_lint
30+
steps:
31+
- uses: actions/checkout@v5
32+
- uses: ./.github/actions/setup-macos
33+
- name: Install test dependencies
34+
shell: bash -l {0}
35+
run: |
36+
pip install unittest-xml-reporting
37+
pip install -e ".[test]"
38+
- name: Run tests
39+
shell: bash -l {0}
40+
run: |
41+
python -m xmlrunner discover -v tests -o test-results/

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PyPI Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
14+
build_release:
15+
if: github.repository == 'ml-explore/mlx'
16+
runs-on: ubuntu-22.04
17+
permissions:
18+
id-token: write
19+
environment:
20+
name: pypi
21+
url: https://pypi.org/p/mlx-lm
22+
steps:
23+
- uses: actions/checkout@v5
24+
- uses: actions/setup-python@v6
25+
with:
26+
python-version: "3.10"
27+
- name: Build package
28+
shell: sh
29+
run: |
30+
pip install build
31+
python -m build
32+
- name: Upload artifacts
33+
uses: actions/upload-artifact@v5
34+
with:
35+
overwrite: true
36+
name: mlx-lm
37+
path: dist/*
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
repository-url: https://upload.pypi.org/legacy/

0 commit comments

Comments
 (0)