Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 26 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@ jobs:
fail-fast: false
matrix:
container_image:
- quay.io/centos/centos:stream8
- quay.io/centos/centos:stream9
- registry.fedoraproject.org/fedora:37
- registry.fedoraproject.org/fedora:38
- registry.fedoraproject.org/fedora:39
- quay.io/centos/centos:stream10
- registry.fedoraproject.org/fedora:40
- registry.fedoraproject.org/fedora:41
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
- registry.access.redhat.com/ubi9
dotnet_version:
- "6.0"
- "7.0"
include:
- container_image: quay.io/centos/centos:stream9
dotnet_version: "8.0"

- "8.0"
- "9.0"

container:
image: ${{ matrix.container_image }}
options: --security-opt seccomp=unconfined
Expand All @@ -38,13 +34,13 @@ jobs:
timeout-minutes: 5
run: |
set -euo pipefail
if command -v dnf; then
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
elif command -v apk; then
apk add bash curl git icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ make zlib
curl -sSLO https://dot.net/v1/dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel ${{ matrix.dotnet_version }}
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
dnf install -y \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
fi

- uses: actions/checkout@v2
Expand Down Expand Up @@ -80,21 +76,16 @@ jobs:
fail-fast: false
matrix:
container_image:
- quay.io/centos/centos:stream8
- quay.io/centos/centos:stream9
- registry.fedoraproject.org/fedora:37
- registry.fedoraproject.org/fedora:38
- registry.fedoraproject.org/fedora:39
- quay.io/centos/centos:stream10
- registry.fedoraproject.org/fedora:40
- registry.fedoraproject.org/fedora:41
- registry.fedoraproject.org/fedora:rawhide
- registry.access.redhat.com/ubi8
- registry.access.redhat.com/ubi9
dotnet_version:
- "6.0"
- "7.0"
include:
- container_image: quay.io/centos/centos:stream9
dotnet_version: "8.0"

- "8.0"
- "9.0"

container:
image: ${{ matrix.container_image }}
Expand All @@ -106,6 +97,13 @@ jobs:
run: |
set -euo pipefail
dnf install -y dotnet-sdk-${{ matrix.dotnet_version }} git make
dnf install -y \
dotnet-sdk-dbg-${{ matrix.dotnet_version }} \
dotnet-runtime-dbg-${{ matrix.dotnet_version }} \
aspnetcore-runtime-dbg-${{ matrix.dotnet_version }}
if [[ ${{ matrix.dotnet_version }} == 9.* ]]; then
dnf install -y dotnet-sdk-aot-${{ matrix.dotnet_version }}
fi

# We need to fetch the tags, so 'git tag' in 'make publish' below works
- uses: actions/checkout@v2
Expand All @@ -127,9 +125,7 @@ jobs:
- name: Install Test dependencies
timeout-minutes: 2
run: |
dnf install -y python3 wget \
$(grep '^Dependencies(dnf): ' dotnet-regular-tests/README.md | cut -d: -f2-) \
--skip-broken
dnf install -y python3 wget $(grep '^Dependencies(dnf): ' dotnet-regular-tests/README.md | cut -d: -f2-) --skip-broken

- name: Run reproducers
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
steps:

- name: Download build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4.1.7
with:
name: release-binaries

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "BashTestSpecificToDotNet2x",
"name": "BashTestSpecificToDotNet6x",
"enabled": true,
"requiresSdk": true,
"version": "2.x",
"version": "6.x",
"versionSpecific": true,
"type": "bash",
"cleanup": true,
Expand Down
36 changes: 0 additions & 36 deletions Turkey.Tests/CsprojCompatibilityPatcherTest.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Turkey.Tests/SourceBuildTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage messag
}
}

[Fact]
public async Task VerifyProdConFeedIsLookedUpAndThenTheFeedIsVerifiedToResolve()
{
var messageHandler = new ProdConHandler();
var client = new HttpClient(messageHandler);
var sourceBuild = new SourceBuild(client);

var feed = await sourceBuild.GetProdConFeedAsync(Version.Parse("3.1"));

Assert.Equal(FAKE_FEED, feed);
}

[Fact]
public async Task VerifyProdConFeedIsNotUsedForNewReleases()
Expand Down
2 changes: 1 addition & 1 deletion Turkey/BashTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override async Task<TestResult> InternalRunAsync(Action<string> logger
startInfo.EnvironmentVariables.Add(key, value);
}

int exitCode = await ProcessRunner.RunAsync(startInfo, logger, cancellationToken);
int exitCode = await ProcessRunner.RunAsync(startInfo, logger, cancellationToken).ConfigureAwait(false);

return exitCode == 0 ? TestResult.Passed : TestResult.Failed;
}
Expand Down
15 changes: 11 additions & 4 deletions Turkey/Cleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public static IEnumerable<string> LocalProjectCruft()
yield return "project.lock.json";
}

public async Task CleanProjectLocalDotNetCruftAsync()
#pragma warning disable CA1822 // Mark members as static
public Task CleanProjectLocalDotNetCruftAsync()
#pragma warning restore CA1822 // Mark members as static
{

foreach(var name in LocalProjectCruft())
Expand All @@ -51,9 +53,12 @@ public async Task CleanProjectLocalDotNetCruftAsync()
File.Delete(name);
}
}
return Task.CompletedTask;
}

public async Task CleanLocalDotNetCacheAsync()
#pragma warning disable CA1822 // Mark members as static
public Task CleanLocalDotNetCacheAsync()
#pragma warning restore CA1822 // Mark members as static
{
foreach (var path in CruftDirectoryGlobs())
{
Expand All @@ -77,12 +82,14 @@ public async Task CleanLocalDotNetCacheAsync()
Console.WriteLine($"WARNING: unable to expand {path}");
}
}
return;
return Task.CompletedTask;
}

#pragma warning disable CA1822 // Mark members as static
public IEnumerable<string> ExpandPath(string pathWithGlob)
#pragma warning restore CA1822 // Mark members as static
{
if (pathWithGlob.StartsWith("~"))
if (pathWithGlob.StartsWith("~", StringComparison.Ordinal))
{
pathWithGlob = Environment.GetEnvironmentVariable("HOME") + pathWithGlob.Substring(1);
}
Expand Down
33 changes: 0 additions & 33 deletions Turkey/CsprojCompatibilityPatcher.cs

This file was deleted.

6 changes: 4 additions & 2 deletions Turkey/DotNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public List<Version> RuntimeVersions
string output = p.StandardOutput.ReadToEnd();
var list = output
.Split("\n", StringSplitOptions.RemoveEmptyEntries)
.Where(line => line.StartsWith("Microsoft.NETCore.App"))
.Where(line => line.StartsWith("Microsoft.NETCore.App", StringComparison.Ordinal))
.Select(line => line.Split(" ")[1])
.Select(versionString => Version.Parse(versionString))
.OrderBy(x => x)
Expand Down Expand Up @@ -137,7 +137,7 @@ private async Task<int> RunDotNetCommandAsync(DirectoryInfo workingDirectory, st
startInfo.EnvironmentVariables.Add(key, value);
}

return await ProcessRunner.RunAsync(startInfo, logger, token);
return await ProcessRunner.RunAsync(startInfo, logger, token).ConfigureAwait(false);
}

private static bool IsCoreClrRuntime(string dotnetRoot, Version version)
Expand All @@ -159,7 +159,9 @@ private static bool IsCoreClrRuntime(string dotnetRoot, Version version)
return File.Exists(Path.Combine(runtimeDir, "libcoreclrtraceptprovider.so"));
}

#nullable enable
private static string? FindProgramInPath(string program)
#nullable disable
{
string[] paths = Environment.GetEnvironmentVariable("PATH")?.Split(':', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>();
foreach (string p in paths)
Expand Down
2 changes: 1 addition & 1 deletion Turkey/IEnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static async Task ForEachAsync<T>(this IEnumerable<T> items, Func<T, Task
{
foreach (T item in items)
{
await task(item);
await task(item).ConfigureAwait(false);
}
}
}
Expand Down
32 changes: 20 additions & 12 deletions Turkey/NuGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,34 @@ public NuGet(HttpClient client)
public async Task<bool> IsPackageLiveAsync(string name, Version version)
{
var url = $"https://api-v2v3search-0.nuget.org/autocomplete?id={name}&prerelease=true";
var result = await _client.GetStringAsync(url);
return await IsPackageLiveAsync(name, version, result);
Uri uri = new(url);
var result = await _client.GetStringAsync(uri).ConfigureAwait(false);
return await IsPackageLiveAsync(name, version, result).ConfigureAwait(false);
}

public async Task<bool> IsPackageLiveAsync(string name, Version version, string json)
#pragma warning disable CA1801 // Remove unused parameter
#pragma warning disable CA1822 // Mark members as static
public Task<bool> IsPackageLiveAsync(string name, Version version, string json)
#pragma warning restore CA1822 // Mark members as static
#pragma warning restore CA1801 // Remove unused parameter
{
JObject deserialized = (JObject) JsonConvert.DeserializeObject(json);
JArray versions = (JArray) deserialized.GetValue("data");
JArray versions = (JArray) deserialized.GetValue("data", StringComparison.Ordinal);
var found = versions.Children<JToken>()
.Where(v => v.Value<string>().Equals(version.ToString()))
.Where(v => v.Value<string>().Equals(version.ToString(), StringComparison.Ordinal))
.Any();
return found;
return Task.FromResult(found);
}

public async Task<string> GenerateNuGetConfig(List<string> urls, string nugetConfig = null)
#pragma warning disable CA1822 // Mark members as static
public Task<string> GenerateNuGetConfig(List<string> urls, string nugetConfig = null)
#pragma warning restore CA1822 // Mark members as static
{
if( !urls.Any() && nugetConfig == null )
throw new ArgumentNullException();
if (!urls.Any())
ArgumentNullException.ThrowIfNull(nugetConfig);

string sources = null;
if( urls.Any() )
if (urls.Any())
{
var sourceParts = new List<string>(urls.Count);
for( int i = 0; i < urls.Count; i++ )
Expand All @@ -54,6 +61,7 @@ public async Task<string> GenerateNuGetConfig(List<string> urls, string nugetCon
{
sources = $" {sources}\n";
}

}

if( string.IsNullOrWhiteSpace(nugetConfig) )
Expand All @@ -66,9 +74,9 @@ public async Task<string> GenerateNuGetConfig(List<string> urls, string nugetCon
}

if( !string.IsNullOrWhiteSpace(sources) )
nugetConfig = nugetConfig.Replace("</packageSources>", sources + "</packageSources>");
nugetConfig = nugetConfig.Replace("</packageSources>", sources + "</packageSources>", StringComparison.Ordinal);

return nugetConfig;
return Task.FromResult(nugetConfig);
}

}
Expand Down
Loading
Loading