2023-12-15 19:33:52 +00:00
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2024-01-14 17:19:45 +00:00
|
|
|
arch: [amd64, arm64]
|
|
|
|
exclude:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
arch: arm64
|
|
|
|
- os: windows-latest
|
|
|
|
arch: arm64
|
2023-12-15 19:33:52 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-01-14 17:19:45 +00:00
|
|
|
env:
|
|
|
|
GOARCH: ${{ matrix.arch }}
|
2023-12-15 19:33:52 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-01-12 17:03:06 +00:00
|
|
|
- uses: actions/setup-go@v5
|
2023-12-15 19:33:52 +00:00
|
|
|
with:
|
2024-01-18 19:51:34 +00:00
|
|
|
go-version: '1.21'
|
2023-12-15 19:33:52 +00:00
|
|
|
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:
|
2024-01-14 17:19:45 +00:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
|
2023-12-15 19:33:52 +00:00
|
|
|
path: |
|
|
|
|
llm/llama.cpp/build/**/lib/*
|
|
|
|
lint:
|
|
|
|
needs: generate
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2024-01-14 17:19:45 +00:00
|
|
|
arch: [amd64, arm64]
|
|
|
|
exclude:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
arch: arm64
|
|
|
|
- os: windows-latest
|
|
|
|
arch: arm64
|
|
|
|
- os: macos-latest
|
|
|
|
arch: amd64
|
2023-12-15 19:33:52 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-01-14 17:19:45 +00:00
|
|
|
env:
|
|
|
|
GOARCH: ${{ matrix.arch }}
|
|
|
|
CGO_ENABLED: "1"
|
2023-12-15 19:33:52 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-01-12 17:03:06 +00:00
|
|
|
- uses: actions/setup-go@v5
|
2023-12-15 19:33:52 +00:00
|
|
|
with:
|
2024-01-18 19:51:34 +00:00
|
|
|
go-version: '1.21'
|
2023-12-15 19:33:52 +00:00
|
|
|
cache: false
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
2024-01-14 17:19:45 +00:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
|
2023-12-15 19:33:52 +00:00
|
|
|
path: llm/llama.cpp/build
|
|
|
|
- uses: golangci/golangci-lint-action@v3
|
|
|
|
test:
|
|
|
|
needs: generate
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2024-01-18 03:00:30 +00:00
|
|
|
arch: [amd64]
|
2024-01-14 17:19:45 +00:00
|
|
|
exclude:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
arch: arm64
|
|
|
|
- os: windows-latest
|
|
|
|
arch: arm64
|
2023-12-15 19:33:52 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2024-01-13 00:28:00 +00:00
|
|
|
env:
|
|
|
|
GOARCH: ${{ matrix.arch }}
|
|
|
|
CGO_ENABLED: "1"
|
2023-12-15 19:33:52 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-01-12 17:03:06 +00:00
|
|
|
- uses: actions/setup-go@v5
|
2023-12-15 19:33:52 +00:00
|
|
|
with:
|
2024-01-18 19:51:34 +00:00
|
|
|
go-version: '1.21'
|
2023-12-15 19:33:52 +00:00
|
|
|
cache: true
|
|
|
|
- run: go get
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
2024-01-14 17:19:45 +00:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.arch }}-libraries
|
2023-12-15 19:33:52 +00:00
|
|
|
path: llm/llama.cpp/build
|
|
|
|
- run: go build
|
|
|
|
- run: go test -v ./...
|