Skip to content

Commit 4af7c56

Browse files
authored
ci : Move msvc to matrix (#1318)
Enable static builds and testing
1 parent f1b539d commit 4af7c56

File tree

1 file changed

+14
-34
lines changed

1 file changed

+14
-34
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,50 @@ jobs:
1010
build:
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest, macos-latest, macos-13]
13+
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
1414
libraries: [shared, static]
1515

1616
runs-on: ${{ matrix.os }}
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- name: Clone
20+
uses: actions/checkout@v4
2021

2122
- name: Dependencies for Ubuntu
2223
if: matrix.os == 'ubuntu-latest'
2324
run: |
2425
sudo apt-get update
2526
sudo apt-get install llvm
2627
28+
- name: Add msbuild to PATH
29+
if: matrix.os == 'windows-latest'
30+
uses: microsoft/setup-msbuild@v2
31+
2732
- name: Create Build Environment
2833
run: mkdir build
2934

3035
- name: Configure CMake
3136
working-directory: ./build
3237
run: cmake ..
33-
-G Ninja
34-
-DCMAKE_C_COMPILER=clang
35-
-DCMAKE_CXX_COMPILER=clang++
38+
${{ contains(matrix.os, 'windows') && '-A x64' || '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' }}
39+
${{ matrix.libraries == 'static' && '-DBUILD_SHARED_LIBS=OFF' || '-DBUILD_SHARED_LIBS=ON' }}
3640
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installed
3741
-DGGML_METAL=OFF
38-
${{ contains(matrix.libraries, 'static') && '-DBUILD_SHARED_LIBS=OFF' || '-DBUILD_SHARED_LIBS=ON' }}
3942

4043
- name: Build
4144
working-directory: ./build
42-
run: cmake --build .
45+
run: cmake --build . ${{ contains(matrix.os, 'windows') && '--config Release' || '' }}
4346

4447
- name: Test
4548
working-directory: ./build
46-
run: ctest --verbose --timeout 900
49+
run: ctest --verbose --timeout 900 ${{ contains(matrix.os, 'windows') && '--build-config Release' || '' }}
4750

4851
- name: Install
4952
working-directory: ./build
50-
run: cmake --build . --target install
53+
run: cmake --build . --target install ${{ contains(matrix.os, 'windows') && '--config Release' || '' }}
5154

5255
- name: Test CMake config
5356
run: |
5457
mkdir test-cmake
55-
cmake -S examples/test-cmake -B test-cmake -DCMAKE_PREFIX_PATH=${{ github.workspace }}/installed
56-
cmake --build test-cmake
57-
58-
windows:
59-
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
60-
github.event.inputs.run_type == 'full-ci' }}
61-
runs-on: windows-latest
62-
63-
steps:
64-
- name: Clone
65-
uses: actions/checkout@v4
66-
67-
- name: Add msbuild to PATH
68-
uses: microsoft/setup-msbuild@v2
69-
70-
- name: Configure
71-
run: >
72-
cmake -S . -B ./build -A x64
73-
-DCMAKE_BUILD_TYPE=Release
74-
-DBUILD_SHARED_LIBS=ON
75-
76-
- name: Build
77-
run: |
78-
cd ./build
79-
msbuild ALL_BUILD.vcxproj -t:build -p:configuration=Release -p:platform=x64
58+
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++' }}
59+
cmake --build test-cmake ${{ contains(matrix.os, 'windows') && '--config Release' || '' }}

0 commit comments

Comments
 (0)