From b0d790d14142fab70584b74e8aa4aedbd4c42da8 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sat, 9 May 2026 11:23:58 -0500 Subject: [PATCH] Speed up CI with NuGet cache + solution-wide build - setup-dotnet@v5 with cache: true persists ~/.nuget/packages between runs, keyed on **/*.csproj. Cold restore (~90s) becomes a tar extract on cache hit. - Replace five sequential dotnet restore + five sequential dotnet build invocations with one each against PlanViewer.sln. MSBuild builds the dependency graph in parallel internally, and we save four MSBuild startup cycles. - Tests still build via the solution build, then run with --no-build. PlanViewer.Ssms and PlanViewer.Ssms.Installer are intentionally not in PlanViewer.sln, so they remain excluded from CI as before. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26b6f82..1f7b77c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,25 +17,17 @@ jobs: uses: actions/setup-dotnet@v5 with: dotnet-version: 8.0.x + cache: true + cache-dependency-path: '**/*.csproj' - name: Install WASM workload run: dotnet workload install wasm-tools - - name: Restore dependencies - run: | - dotnet restore src/PlanViewer.Core/PlanViewer.Core.csproj - dotnet restore src/PlanViewer.App/PlanViewer.App.csproj - dotnet restore src/PlanViewer.Cli/PlanViewer.Cli.csproj - dotnet restore src/PlanViewer.Web/PlanViewer.Web.csproj - dotnet restore tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj - - - name: Build all projects - run: | - dotnet build src/PlanViewer.Core/PlanViewer.Core.csproj -c Release --no-restore - dotnet build src/PlanViewer.App/PlanViewer.App.csproj -c Release --no-restore - dotnet build src/PlanViewer.Cli/PlanViewer.Cli.csproj -c Release --no-restore - dotnet build src/PlanViewer.Web/PlanViewer.Web.csproj -c Release --no-restore - dotnet build tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-restore + - name: Restore solution + run: dotnet restore PlanViewer.sln + + - name: Build solution + run: dotnet build PlanViewer.sln -c Release --no-restore - name: Run tests run: dotnet test tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-build --verbosity normal