Windows CI (#3021)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
name: 'Build on Windows'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Build CPP only
|
||||
shell: cmd
|
||||
env:
|
||||
# For MSVC, Ninja/Release is the only config supported by ccache.
|
||||
CMAKE_ARGS: >-
|
||||
-G Ninja
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DCMAKE_C_COMPILER=cl
|
||||
-DCMAKE_CXX_COMPILER=cl
|
||||
-DCMAKE_RC_COMPILER=rc
|
||||
run: |
|
||||
cmake . -B build %CMAKE_ARGS%
|
||||
cmake --build build -j %NUMBER_OF_PROCESSORS%
|
||||
@@ -0,0 +1,37 @@
|
||||
name: 'Setup Windows environment'
|
||||
|
||||
inputs:
|
||||
python-version:
|
||||
description: 'Version of python to set up'
|
||||
required: false
|
||||
default: '3.14'
|
||||
use-ccache:
|
||||
description: 'Whether to enable ccache'
|
||||
required: false
|
||||
default: 'true'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Use ccache
|
||||
if: ${{ inputs.use-ccache == 'true' }}
|
||||
uses: hendrikmuhs/[email protected]
|
||||
with:
|
||||
key: ccache-${{ runner.os }}-${{ runner.arch }}-cpu
|
||||
max-size: 1GB
|
||||
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
|
||||
- name: Setup Visual Studio cmd
|
||||
shell: cmd
|
||||
run: |
|
||||
:: Find out path to VS.
|
||||
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
|
||||
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
|
||||
popd
|
||||
:: Import VS vars.
|
||||
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
|
||||
:: Export to all steps.
|
||||
>>%GITHUB_ENV% set
|
||||
@@ -0,0 +1,13 @@
|
||||
name: 'Run tests on Windows'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Run CPP tests - CPU
|
||||
shell: bash
|
||||
env:
|
||||
DEVICE: cpu
|
||||
run: |
|
||||
echo "::group::CPP tests - CPU"
|
||||
./build/tests/tests -tce="*gguf*,test random uniform"
|
||||
echo "::endgroup::"
|
||||
@@ -76,6 +76,18 @@ jobs:
|
||||
- uses: ./.github/actions/setup-macos
|
||||
- uses: ./.github/actions/build-macos
|
||||
|
||||
windows_build_and_test:
|
||||
name: Windows (cpu, x86_64)
|
||||
needs: check_lint
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/setup-windows
|
||||
with:
|
||||
use-ccache: false
|
||||
- uses: ./.github/actions/build-windows
|
||||
- uses: ./.github/actions/test-windows
|
||||
|
||||
build_documentation:
|
||||
name: Build Documentation
|
||||
if: github.repository == 'ml-explore/mlx'
|
||||
|
||||
Reference in New Issue
Block a user