Merge pull request #1240 from SciSharp/dependabot/nuget/LLama.Semanti… #2090
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [linux-release, windows-release, osx-release] | |
include: | |
- build: linux-release | |
os: ubuntu-latest | |
config: release | |
- build: osx-release | |
os: macos-14 # https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ | |
config: release | |
- build: windows-release | |
os: windows-2022 | |
config: release | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: jlumbroso/[email protected] | |
with: | |
dotnet: false | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
- name: Install Mobile Workloads | |
if: ${{ contains(runner.os, 'windows') }} | |
run: | | |
dotnet workload install android --ignore-failed-sources | |
dotnet workload install maui --ignore-failed-sources | |
- name: Remove Mobile Project | |
if: ${{ !contains(runner.os, 'windows') }} | |
run: | | |
dotnet sln LLamaSharp.sln remove Llama.Mobile | |
- name: Cache Packages | |
uses: actions/cache@v4 | |
with: | |
key: "unit_test_models" | |
path: LLama.Unittest/Models | |
# workaround for actions/setup-dotnet#155 | |
- name: Clear package cache | |
run: dotnet clean LLamaSharp.sln && dotnet nuget locals all --clear | |
- name: Restore packages | |
run: dotnet restore LLamaSharp.sln | |
- name: Build | |
run: dotnet build LLamaSharp.sln -c ${{ matrix.config }} --no-restore | |
- name: Test | |
run: dotnet test LLamaSharp.sln -c ${{ matrix.config }} -l "console;verbosity=detailed" --diag:logs/log.txt --filter Category!=NoCI | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
path: logs/ | |
name: logs-${{ matrix.os }} |