mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-10 22:46:53 +08:00
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: 'Build and Test on Linux'
|
|
|
|
inputs:
|
|
toolkit:
|
|
description: 'The toolkit to build with'
|
|
required: false
|
|
default: 'cpu'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Set cmake args
|
|
shell: bash
|
|
env:
|
|
CMAKE_ARGS_CPU: >
|
|
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
|
|
-DMLX_BUILD_CUDA=OFF
|
|
CMAKE_ARGS_CUDA: >
|
|
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
|
|
-DCMAKE_CUDA_COMPILER=/usr/local/${{ inputs.toolkit }}/bin/nvcc
|
|
-DMLX_BUILD_CUDA=ON
|
|
run: |
|
|
echo CMAKE_ARGS="$CMAKE_ARGS_${{ startsWith(inputs.toolkit, 'cuda') && 'CUDA' || 'CPU' }}" > $GITHUB_ENV
|
|
|
|
- name: Install Python package
|
|
shell: sh
|
|
env:
|
|
DEBUG: 1
|
|
run: pip install --no-build-isolation -e ".[dev]" -v
|
|
|
|
- name: Generate package stubs
|
|
shell: sh
|
|
run: |
|
|
pip install typing_extensions
|
|
python setup.py generate_stubs
|
|
|
|
- name: Build CPP only
|
|
shell: bash
|
|
run: |
|
|
cmake . -B build -DCMAKE_BUILD_TYPE=Debug ${{ env.CMAKE_ARGS }}
|
|
cmake --build build -j $(nproc)
|