From d65915715f71e9c8ff1222d2cad451f699c5f99e Mon Sep 17 00:00:00 2001 From: PierreGode <8579922+PierreGode@users.noreply.github.com> Date: Sun, 31 Mar 2024 18:54:58 +0200 Subject: [PATCH] Update test.yaml --- .github/workflows/test.yaml | 132 ++++++++++-------------------------- 1 file changed, 35 insertions(+), 97 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 20f43d4217c..45c4be231ee 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,18 +8,9 @@ on: jobs: generate: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - arch: [amd64, arm64] - exclude: - - os: ubuntu-latest - arch: arm64 - - os: windows-latest - arch: arm64 - runs-on: ${{ matrix.os }} + runs-on: windows-latest env: - GOARCH: ${{ matrix.arch }} + GOARCH: amd64 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -30,82 +21,30 @@ jobs: - run: go generate -x ./... - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }}-${{ matrix.arch }}-libraries + name: windows-amd64-libraries path: llm/llama.cpp/build/**/lib/* + generate-cuda: - strategy: - matrix: - cuda-version: - - '11.8.0' - runs-on: linux - container: nvidia/cuda:${{ matrix.cuda-version }}-devel-ubuntu20.04 + runs-on: windows-latest steps: - - run: | - apt-get update && apt-get install -y git build-essential curl - curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz \ - | tar -zx -C /usr --strip-components 1 - env: - DEBIAN_FRONTEND: noninteractive - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: '1.21' cache: true - run: go get ./... - - run: | - git config --global --add safe.directory /__w/ollama/ollama - go generate -x ./... - env: - OLLAMA_SKIP_CPU_GENERATE: '1' - - uses: actions/upload-artifact@v4 - with: - name: cuda-${{ matrix.cuda-version }}-libraries - path: llm/llama.cpp/build/**/lib/* - generate-rocm: - strategy: - matrix: - rocm-version: - - '5.7.1' - - '6.0' - runs-on: linux - container: rocm/dev-ubuntu-20.04:${{ matrix.rocm-version }} - steps: - - run: | - apt-get update && apt-get install -y git build-essential curl rocm-libs - curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz \ - | tar -zx -C /usr --strip-components 1 - env: - DEBIAN_FRONTEND: noninteractive - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 - with: - go-version: '1.21' - cache: true - - run: go get ./... - - run: | - git config --global --add safe.directory /__w/ollama/ollama - go generate -x ./... + - run: go generate -x ./... env: OLLAMA_SKIP_CPU_GENERATE: '1' - uses: actions/upload-artifact@v4 with: - name: rocm-${{ matrix.rocm-version }}-libraries + name: windows-cuda-libraries path: llm/llama.cpp/build/**/lib/* + lint: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - arch: [amd64, arm64] - exclude: - - os: ubuntu-latest - arch: arm64 - - os: windows-latest - arch: arm64 - - os: macos-latest - arch: amd64 - runs-on: ${{ matrix.os }} + runs-on: windows-latest env: - GOARCH: ${{ matrix.arch }} + GOARCH: amd64 CGO_ENABLED: "1" steps: - uses: actions/checkout@v4 @@ -116,33 +55,15 @@ jobs: go-version: '1.21' cache: false - run: | - mkdir -p llm/llama.cpp/build/linux/${{ matrix.arch }}/stub/lib/ - touch llm/llama.cpp/build/linux/${{ matrix.arch }}/stub/lib/stub.so - if: ${{ startsWith(matrix.os, 'ubuntu-') }} - - run: | - mkdir -p llm/llama.cpp/build/darwin/${{ matrix.arch }}/stub/lib/ - touch llm/llama.cpp/build/darwin/${{ matrix.arch }}/stub/lib/stub.dylib - touch llm/llama.cpp/ggml-metal.metal - if: ${{ startsWith(matrix.os, 'macos-') }} - - run: | - mkdir -p llm/llama.cpp/build/windows/${{ matrix.arch }}/stub/lib/ - touch llm/llama.cpp/build/windows/${{ matrix.arch }}/stub/lib/stub.dll - if: ${{ startsWith(matrix.os, 'windows-') }} + mkdir -p llm/llama.cpp/build/windows/amd64/stub/lib/ + touch llm/llama.cpp/build/windows/amd64/stub/lib/stub.dll - uses: golangci/golangci-lint-action@v3 + test: - needs: generate - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - arch: [amd64] - exclude: - - os: ubuntu-latest - arch: arm64 - - os: windows-latest - arch: arm64 - runs-on: ${{ matrix.os }} + needs: [generate, generate-cuda] + runs-on: windows-latest env: - GOARCH: ${{ matrix.arch }} + GOARCH: amd64 CGO_ENABLED: "1" steps: - uses: actions/checkout@v4 @@ -155,11 +76,28 @@ jobs: - run: go get - uses: actions/download-artifact@v4 with: - name: ${{ matrix.os }}-${{ matrix.arch }}-libraries + name: windows-amd64-libraries path: llm/llama.cpp/build - run: go build - run: go test -v ./... - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }}-binaries + name: windows-binaries path: ollama + + release: + needs: test + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: windows-binaries + path: release + - name: Create Release + run: | + TAG_NAME=$(date +'%Y%m%d%H%M%S')-$(git rev-parse --short HEAD) + gh release create "$TAG_NAME" ./release/* --draft --title "New Release $TAG_NAME" --notes "Automated release $TAG_NAME" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file