refactor: ♻️ enhance cache-models and model-options loading #35
Workflow file for this run
This file contains 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: Build-Test | |
on: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- "tree-sitter/**" | |
- "scripts/**" | |
pull_request: | |
branches: | |
- "main" | |
paths-ignore: | |
- "tree-sitter/**" | |
- "scripts/**" | |
env: | |
DOTNET_VERSION: "8.0.*" | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/cloudbuild.md#github-actions | |
fetch-depth: 0 # doing deep clone and avoid shallow clone so nbgv can do its work. | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Cache NuGet packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: nuget-cache-${{ runner.os }}-${{ env.DOTNET_VERSION }}-build-test | |
# https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/doc/nbgv-cli.md | |
- name: Install Nerdbank.GitVersioning | |
run: dotnet tool install -g nbgv | |
- name: Get PackageVersion | |
id: get_version | |
run: | | |
nugetVersion=$(nbgv get-version | grep "NuGetPackageVersion" | awk -F': ' '{print $2}' | xargs) | |
echo "NuGetPackageVersion: $nugetVersion" | |
echo "::set-output name=nuget_version::$nugetVersion" | |
- name: Restore dependencies | |
run: dotnet restore AIAssistant.sln | |
- name: Build Version ${{ steps.get_version.outputs.nuget_version }} | |
run: dotnet build AIAssistant.sln -c Release --no-restore | |
- name: Test Version ${{ steps.get_version.outputs.nuget_version }} | |
run: | | |
dotnet test AIAssistant.sln -c Release --no-restore --no-build |