Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: use stubs libraries #2061

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 17 additions & 53 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,7 @@ on:
pull_request:

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 }}
env:
GOARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- if: ${{ startsWith(matrix.os, 'windows-') }}
shell: pwsh
run: |
$path = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($path) {
$path = join-path $path 'Common7\Tools\vsdevcmd.bat'
if (test-path $path) {
cmd /s /c """$path"" $args && set" | where { $_ -match '(\w+)=(.*)' } | foreach {
echo "$($Matches[1])=$($Matches[2])" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
}
}
}

echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- run: go get ./...
- run: go generate -x ./...
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
path: |
llm/llama.cpp/build/**/lib/*
lint:
needs: generate
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -68,23 +27,26 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
path: llm/llama.cpp/build
- run: |
tolower() { echo $1 | tr '[:upper:]' '[:lower:]'; }
case $RUNNER_OS in X64) RUNNER_OS="x86_64" ;; ARM64) arm64 ;; esac
mkdir -p llm/llama.cpp/build/$RUNNER_OS/$(tolower $RUNNER_ARCH)/stub/lib
touch llm/llama.cpp/build/$RUNNER_OS/$(tolower $RUNNER_ARCH)/stub/lib/stub.{dylib,so,dll}
touch llm/llama.cpp/ggml-metal.metal
shell: bash
- uses: golangci/golangci-lint-action@v3
test:
needs: generate
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [amd64]
arch: [amd64, arm64]
exclude:
- os: ubuntu-latest
arch: arm64
- os: windows-latest
arch: arm64
- os: macos-latest
arch: amd64
runs-on: ${{ matrix.os }}
env:
GOARCH: ${{ matrix.arch }}
Expand All @@ -96,11 +58,13 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true
- run: |
tolower() { echo $1 | tr '[:upper:]' '[:lower:]'; }
case $RUNNER_OS in X64) RUNNER_OS="x86_64" ;; ARM64) arm64 ;; esac
mkdir -p llm/llama.cpp/build/$RUNNER_OS/$(tolower $RUNNER_ARCH)/stub/lib
touch llm/llama.cpp/build/$RUNNER_OS/$(tolower $RUNNER_ARCH)/stub/lib/stub.{dylib,so,dll}
touch llm/llama.cpp/ggml-metal.metal
shell: bash
- run: go get
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
path: llm/llama.cpp/build
- run: go build
- run: go test -v ./...
Loading