Cache nugets in CI
Fix #2202
Https certs are still installed even with that env variable in place. Not sure why.
I had problems with hashes not matching, and had the delete selected folders from my nuget cache to be able to build on CI and locally, apparently the local nuget was "outdated" and had different hash but the same version, no idea why, but I found it mentioned in few places. If this turns out to be a big problem we can set nuget to restore to cache folder that is specific to Pester.
Perfect and now it failed :D Can't investigate right now.
Close/Reopened to trigger fresh CI-run
Gave it shot.
- We always restore in
build.ps1, so I removed the nuget restore step to avoid having two restore-commands with potential conflict. - Then it complained about SMA 6.1.0 -> 6.0.4 dep. change which is correct. Merged main + updated lock file
- Now Pester-project works, but PesterTests fails with a even more confusing error
Restored D:\a\1\s\src\csharp\Pester\Pester.csproj (in 10.2 sec).
D:\a\1\s\src\csharp\PesterTests\PesterTests.csproj : error NU1102: Unable to find package NETStandard.Library with version (>= 1.6.1) [D:\a\1\s\src\csharp\Pester.sln]
D:\a\1\s\src\csharp\PesterTests\PesterTests.csproj : error NU1102: - Found 10 version(s) in nuget.org [ Nearest version: 1.6.1 ] [D:\a\1\s\src\csharp\Pester.sln]
D:\a\1\s\src\csharp\PesterTests\PesterTests.csproj : error NU1102: - Found 3 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 1.6.1 ] [D:\a\1\s\src\csharp\Pester.sln]
Which is it, a match or not? 🤷♂️
Because I generated lock file on ubuntu while CI is Windows?
Try changing to windows-2022 (.NET 6) for build image? Update: Submitted #2249
Yeah the errors are confusing.
@fflaten I merged the other PR if you want to have another look.
The HTTPS certificate isn't created after all. It's just a hardcoded text in a first run string, see https://github.com/dotnet/sdk/issues/12195#issuecomment-662159293. Verified in another pipeline using dotnet dev-certs https --check after dotnet restore.
We can hide the remaining HTTPS + ASP messages using DOTNET_NOLOGO and just log the current SDK.