Skip to content

Commit b0d790d

Browse files
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) <noreply@anthropic.com>
1 parent eb1f4d5 commit b0d790d

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,17 @@ jobs:
1717
uses: actions/setup-dotnet@v5
1818
with:
1919
dotnet-version: 8.0.x
20+
cache: true
21+
cache-dependency-path: '**/*.csproj'
2022

2123
- name: Install WASM workload
2224
run: dotnet workload install wasm-tools
2325

24-
- name: Restore dependencies
25-
run: |
26-
dotnet restore src/PlanViewer.Core/PlanViewer.Core.csproj
27-
dotnet restore src/PlanViewer.App/PlanViewer.App.csproj
28-
dotnet restore src/PlanViewer.Cli/PlanViewer.Cli.csproj
29-
dotnet restore src/PlanViewer.Web/PlanViewer.Web.csproj
30-
dotnet restore tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj
31-
32-
- name: Build all projects
33-
run: |
34-
dotnet build src/PlanViewer.Core/PlanViewer.Core.csproj -c Release --no-restore
35-
dotnet build src/PlanViewer.App/PlanViewer.App.csproj -c Release --no-restore
36-
dotnet build src/PlanViewer.Cli/PlanViewer.Cli.csproj -c Release --no-restore
37-
dotnet build src/PlanViewer.Web/PlanViewer.Web.csproj -c Release --no-restore
38-
dotnet build tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-restore
26+
- name: Restore solution
27+
run: dotnet restore PlanViewer.sln
28+
29+
- name: Build solution
30+
run: dotnet build PlanViewer.sln -c Release --no-restore
3931

4032
- name: Run tests
4133
run: dotnet test tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-build --verbosity normal

0 commit comments

Comments
 (0)