From: Kai Pastor Date: Sat, 2 Aug 2025 14:29:48 +0000 (+0200) Subject: ci : Move msvc to matrix (#1318) X-Git-Tag: upstream/0.0.2404~26 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4af7c56643fc5b4dda156cfaf6b05f7ea7ec0680;p=pkg%2Fggml%2Fsources%2Fggml ci : Move msvc to matrix (#1318) Enable static builds and testing --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 536a2416..031cdb09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,13 +10,14 @@ jobs: 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' @@ -24,56 +25,35 @@ jobs: 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' || '' }}