build:
strategy:
matrix:
- os: [ubuntu-latest, macos-latest, macos-13]
+ os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
libraries: [shared, static]
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v3
+ - name: Clone
+ uses: actions/checkout@v4
- name: Dependencies for Ubuntu
if: matrix.os == 'ubuntu-latest'
sudo apt-get update
sudo apt-get install llvm
+ - name: Add msbuild to PATH
+ if: matrix.os == 'windows-latest'
+ uses: microsoft/setup-msbuild@v2
+
- name: Create Build Environment
run: mkdir build
- name: Configure CMake
working-directory: ./build
run: cmake ..
- -G Ninja
- -DCMAKE_C_COMPILER=clang
- -DCMAKE_CXX_COMPILER=clang++
+ ${{ contains(matrix.os, 'windows') && '-A x64' || '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' }}
+ ${{ matrix.libraries == 'static' && '-DBUILD_SHARED_LIBS=OFF' || '-DBUILD_SHARED_LIBS=ON' }}
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installed
-DGGML_METAL=OFF
- ${{ contains(matrix.libraries, 'static') && '-DBUILD_SHARED_LIBS=OFF' || '-DBUILD_SHARED_LIBS=ON' }}
- name: Build
working-directory: ./build
- run: cmake --build .
+ run: cmake --build . ${{ contains(matrix.os, 'windows') && '--config Release' || '' }}
- name: Test
working-directory: ./build
- run: ctest --verbose --timeout 900
+ run: ctest --verbose --timeout 900 ${{ contains(matrix.os, 'windows') && '--build-config Release' || '' }}
- name: Install
working-directory: ./build
- run: cmake --build . --target install
+ run: cmake --build . --target install ${{ contains(matrix.os, 'windows') && '--config Release' || '' }}
- name: Test CMake config
run: |
mkdir test-cmake
- cmake -S examples/test-cmake -B test-cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/installed
- cmake --build test-cmake
-
- windows:
- if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
- github.event.inputs.run_type == 'full-ci' }}
- runs-on: windows-latest
-
- steps:
- - name: Clone
- uses: actions/checkout@v4
-
- - name: Add msbuild to PATH
- uses: microsoft/setup-msbuild@v2
-
- - name: Configure
- run: >
- cmake -S . -B ./build -A x64
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_SHARED_LIBS=ON
-
- - name: Build
- run: |
- cd ./build
- msbuild ALL_BUILD.vcxproj -t:build -p:configuration=Release -p:platform=x64
+ cmake -S examples/test-cmake -B test-cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/installed ${{ contains(matrix.os, 'windows') && '-A x64' || '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' }}
+ cmake --build test-cmake ${{ contains(matrix.os, 'windows') && '--config Release' || '' }}