Merge pull request #3376 from ollama/mxyng/conditional-generate
only generate on changes to llm subdirectory
This commit is contained in:
commit
461ad25015
1 changed files with 36 additions and 13 deletions
49
.github/workflows/test.yaml
vendored
49
.github/workflows/test.yaml
vendored
|
@ -23,11 +23,14 @@ jobs:
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
echo GENERATE_CUDA=$(changed llm)
|
echo GENERATE=$(changed llm/)
|
||||||
echo GENERATE_ROCM=$(changed llm)
|
echo GENERATE_CUDA=$(changed llm/)
|
||||||
|
echo GENERATE_ROCM=$(changed llm/)
|
||||||
} >>$GITHUB_OUTPUT
|
} >>$GITHUB_OUTPUT
|
||||||
|
|
||||||
generate:
|
generate:
|
||||||
|
needs: [changes]
|
||||||
|
if: ${{ needs.changes.outputs.GENERATE == 'True' }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||||
|
@ -150,21 +153,26 @@ jobs:
|
||||||
go-version: '1.22'
|
go-version: '1.22'
|
||||||
cache: false
|
cache: false
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p llm/llama.cpp/build/linux/${{ matrix.arch }}/stub/lib/
|
case ${{ matrix.arch }} in
|
||||||
touch llm/llama.cpp/build/linux/${{ matrix.arch }}/stub/lib/stub.so
|
amd64) echo ARCH=x86_64 ;;
|
||||||
|
arm64) echo ARCH=arm64 ;;
|
||||||
|
esac >>$GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
- run: |
|
||||||
|
mkdir -p llm/llama.cpp/build/linux/$ARCH/stub/lib/
|
||||||
|
touch llm/llama.cpp/build/linux/$ARCH/stub/lib/stub.so
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
|
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p llm/llama.cpp/build/darwin/${{ matrix.arch }}/stub/lib/
|
mkdir -p llm/llama.cpp/build/darwin/$ARCH/stub/lib/
|
||||||
touch llm/llama.cpp/build/darwin/${{ matrix.arch }}/stub/lib/stub.dylib
|
touch llm/llama.cpp/build/darwin/$ARCH/stub/lib/stub.dylib
|
||||||
touch llm/llama.cpp/ggml-metal.metal
|
touch llm/llama.cpp/ggml-metal.metal
|
||||||
if: ${{ startsWith(matrix.os, 'macos-') }}
|
if: ${{ startsWith(matrix.os, 'macos-') }}
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p llm/llama.cpp/build/windows/${{ matrix.arch }}/stub/lib/
|
mkdir -p llm/llama.cpp/build/windows/$ARCH/stub/stub/lib/
|
||||||
touch llm/llama.cpp/build/windows/${{ matrix.arch }}/stub/lib/stub.dll
|
touch llm/llama.cpp/build/windows/$ARCH/stub/stub/lib/stub.dll
|
||||||
if: ${{ startsWith(matrix.os, 'windows-') }}
|
if: ${{ startsWith(matrix.os, 'windows-') }}
|
||||||
- uses: golangci/golangci-lint-action@v3
|
- uses: golangci/golangci-lint-action@v3
|
||||||
test:
|
test:
|
||||||
needs: generate
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||||
|
@ -187,10 +195,25 @@ jobs:
|
||||||
go-version: '1.22'
|
go-version: '1.22'
|
||||||
cache: true
|
cache: true
|
||||||
- run: go get
|
- run: go get
|
||||||
- uses: actions/download-artifact@v4
|
- run: |
|
||||||
with:
|
case ${{ matrix.arch }} in
|
||||||
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
|
amd64) echo ARCH=x86_64 ;;
|
||||||
path: llm/llama.cpp/build
|
arm64) echo ARCH=arm64 ;;
|
||||||
|
esac >>$GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
- run: |
|
||||||
|
mkdir -p llm/llama.cpp/build/linux/$ARCH/stub/lib/
|
||||||
|
touch llm/llama.cpp/build/linux/$ARCH/stub/lib/stub.so
|
||||||
|
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
|
||||||
|
- run: |
|
||||||
|
mkdir -p llm/llama.cpp/build/darwin/$ARCH/stub/lib/
|
||||||
|
touch llm/llama.cpp/build/darwin/$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/$ARCH/stub/stub/lib/
|
||||||
|
touch llm/llama.cpp/build/windows/$ARCH/stub/stub/lib/stub.dll
|
||||||
|
if: ${{ startsWith(matrix.os, 'windows-') }}
|
||||||
- run: go build
|
- run: go build
|
||||||
- run: go test -v ./...
|
- run: go test -v ./...
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
|
Loading…
Add table
Reference in a new issue