Skip to content

Commit

Permalink
Add nuget.org to any custom nuget config file
Browse files Browse the repository at this point in the history
It's the default; we expect customers to use it. But it's possible that
the nuget.config file we use (eg, from source-build) has that removed so
this force-adds it back.
  • Loading branch information
omajid committed Oct 16, 2022
1 parent d8d5e3c commit b6a6f7c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ jobs:
dotnet_version:
- "3.1"
- "6.0"
include:
- container_image: quay.io/centos/centos:stream9-development
dotnet_version: "7.0"
exclude:
- container_image: registry.fedoraproject.org/fedora:rawhide
dotnet_version: "3.1"
- container_image: registry.fedoraproject.org/fedora:37
dotnet_version: "3.1"
# alpine edge has openssl 1.1, not compatible with 3.1
- container_image: docker.io/library/alpine:edge
dotnet_version: "3.1"

container:
image: ${{ matrix.container_image }}
Expand Down Expand Up @@ -143,7 +149,7 @@ jobs:
dotnet --info
dotnet turkey/Turkey.dll dotnet-regular-tests -v
dotnet turkey/Turkey.dll dotnet-regular-tests -v --timeout 600
- name: Show Logs
if: ${{ always() }}
Expand Down
10 changes: 10 additions & 0 deletions Turkey/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public static async Task<int> Run(string testRoot,

Version packageVersion = dotnet.LatestRuntimeVersion;
string nuGetConfig = await GenerateNuGetConfigIfNeededAsync(additionalFeed, packageVersion);
if (verbose && nuGetConfig != null)
{
Console.WriteLine("Using nuget.config: ");
Console.WriteLine(nuGetConfig);
}

TestRunner runner = new TestRunner(
cleaner: cleaner,
Expand Down Expand Up @@ -174,6 +179,11 @@ public static async Task<string> GenerateNuGetConfigIfNeededAsync(string additio

if (urls.Any() || nugetConfig != null)
{
// Add the default nuget repo that customer should always
// be using anyway. This is the default, but still useful
// if the nugetConfig has a <clear/> element that removes
// it.
urls.Add("https://api.nuget.org/v3/index.json");
return await nuget.GenerateNuGetConfig(urls, nugetConfig);
}
}
Expand Down

0 comments on commit b6a6f7c

Please sign in to comment.