11name : ' Build and Test on macOS'
22description : ' Build and test MLX on macOS'
33
4- inputs :
5- build-type :
6- description : ' Build type (debug, release)'
7- required : false
8- default : ' debug'
9- type : choice
10- options :
11- - debug
12- - release
13- run-tests :
14- description : ' Whether to run tests'
15- required : false
16- default : ' true'
17-
184runs :
195 using : " composite"
206 steps :
217 - name : Install dependencies
228 shell : sh
239 env :
2410 DEBUG : 1
25- DEV_RELEASE : 1
11+ CMAKE_ARGS : " -DCMAKE_COMPILE_WARNING_AS_ERROR=ON "
2612 run : |
2713 uv pip install --upgrade pip
2814 uv pip install cmake setuptools nanobind==2.4.0
@@ -35,13 +21,11 @@ runs:
3521 uv run --no-project setup.py generate_stubs
3622
3723 - name : Install tests dependencies
38- if : inputs.run-tests == 'true'
3924 shell : sh
4025 run : |
4126 uv pip install numpy torch tensorflow unittest-xml-reporting
4227
4328 - name : Run Python tests
44- if : inputs.run-tests == 'true'
4529 shell : bash
4630 env :
4731 LOW_MEMORY : 1
5337 if $(grep "\[WARN\]" stderr.log); then echo "Distributed ring test failed"; exit 1; fi
5438
5539 - name : Build example extension
56- if : inputs.run-tests == 'true'
5740 shell : bash
5841 run : |
5942 cd examples/extensions
6245 uv run --no-project test.py
6346
6447 - name : Build CPP only
65- if : inputs.run-tests == 'true'
6648 shell : bash
6749 run : |
6850 mkdir -p build
7153 make -j $(sysctl -n hw.ncpu)
7254
7355 - name : Run CPP tests
74- if : inputs.run-tests == 'true'
7556 shell : bash
7657 env :
7758 DEVICE : gpu
8061 run : ./build/tests/tests
8162
8263 - name : Build small binary with JIT
83- if : inputs.run-tests == 'true'
8464 shell : bash
8565 run : |
8666 mkdir -p build
9474 make -j $(sysctl -n hw.ncpu)
9575
9676 - name : Run Python tests with JIT
97- if : inputs.run-tests == 'true'
9877 shell : bash
9978 env :
10079 LOW_MEMORY : 1
@@ -107,14 +86,3 @@ runs:
10786 uv run -m xmlrunner discover \
10887 -v python/tests \
10988 -o test-results/gpu_jit
110-
111- - name : Build macOS 14 package
112- if : inputs.build-type == 'release'
113- uses : ./.github/actions/build-macos-release
114- with :
115- macos-target : 14.0
116- - name : Build macOS 15 package
117- if : inputs.build-type == 'release'
118- uses : ./.github/actions/build-macos-release
119- with :
120- macos-target : 15.0
0 commit comments