Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dotnet monorepo to v8.0.8 #54

Merged
merged 6 commits into from
Aug 13, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
fetch-depth: 0

- name: Verify using nuke
run: JAVA_HOME=$JAVA_HOME_21_X64 ./build.sh Clean Verify
run: JAVA_HOME=$JAVA_HOME_21_X64 ./build.sh Clean Sonarqube
env:
SONAR_TOKEN: ${{ secrets.sonar_token }}
26 changes: 8 additions & 18 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,13 @@
"type": "string",
"enum": [
"Clean",
"Fix",
"Lint",
"Pack",
"Publish",
"Release",
"RestoreTools",
"Restore",
"Sonarqube",
"Tags",
"Verify",
"VerifyFormat",
"Verifying",
"VerifyOutdated",
"VerifyRoslyn",
"VerifySonarqube"
"Test"
]
}
},
Expand All @@ -103,18 +98,13 @@
"type": "string",
"enum": [
"Clean",
"Fix",
"Lint",
"Pack",
"Publish",
"Release",
"RestoreTools",
"Restore",
"Sonarqube",
"Tags",
"Verify",
"VerifyFormat",
"Verifying",
"VerifyOutdated",
"VerifyRoslyn",
"VerifySonarqube"
"Test"
]
}
},
Expand Down
118 changes: 46 additions & 72 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Build : NukeBuild
{
public static int Main() => Execute<Build>(_ => _.Verify);
public static int Main() => Execute<Build>(_ => _.Test);

[Secret, Parameter] readonly string NugetApikey;
[Secret, Parameter] readonly string SonarToken;
Expand All @@ -32,50 +32,8 @@ class Build : NukeBuild
AbsolutePath NugetGlob => RootDirectory / Constants.Nuget.PackageGlob;
bool IsPreRelease => !string.IsNullOrEmpty(OctoVersionInfo.PreReleaseTag);

Target RestoreTools => _ => _
.Unlisted()
.DependentFor(VerifyOutdated, VerifyRoslyn)
.Executes(() => DotNetTasks.DotNetToolRestore());

Target VerifyFormat => _ => _
.Unlisted()
.Executes(() => DotNetTasks.DotNet("format --verify-no-changes"));

Target VerifyRoslyn => _ => _
.Unlisted()
.Executes(() => DotNetTasks.DotNet("tool run roslynator analyze"));

Target VerifyOutdated => _ => _
.Unlisted()
.Executes(() => DotNetTasks.DotNet("tool run dotnet-outdated --fail-on-updates"));

Target VerifySonarqube => _ => _
.Unlisted()
.Requires(() => SonarToken)
.Executes(() =>
{
SonarScannerTasks.SonarScannerBegin(_ => _
.SetOrganization(SonarOrganization)
.SetProjectKey(SonarKey)
.SetOpenCoverPaths(TestResultsGlob)
.SetServer(Constants.Sonarqube.SonarCloudUrl)
.SetToken(SonarToken)
.SetQualityGateWait(true));

DotNetTasks.DotNetTest(_ => _
.SetProjectFile(TestProject.Path)
.EnableCollectCoverage()
.SetDataCollector(Constants.XUnit.CoverletCollectorName)
.SetResultsDirectory(TestResultsDirectory)
.AddRunSetting(Constants.XUnit.FormatSetting, Constants.XUnit.OpenCoverFormat)
.AddRunSetting(Constants.XUnit.IncludeSetting, TestIncludes));

SonarScannerTasks.SonarScannerEnd(_ => _
.SetToken(SonarToken));
});

Target Clean => _ => _
.Before(RestoreTools)
.Before(Restore, Test)
.Executes(() =>
{
DotNetTasks.DotNetClean();
Expand All @@ -84,24 +42,41 @@ class Build : NukeBuild
DotSonar.DeleteDirectory();
});

Target Fix => _ => _
.Before(Verifying)
.DependsOn(RestoreTools)
Target Restore => _ => _
.Unlisted()
.Executes(() => DotNetTasks.DotNetToolRestore());

Target Lint => _ => _
.DependsOn(Restore)
.Executes(() =>
{
DotNetTasks.DotNet("tool run dotnet-outdated -- --upgrade");
DotNetTasks.DotNetFormat();
DotNetTasks.DotNet("format --verify-no-changes");
DotNetTasks.DotNet("tool run roslynator analyze");
DotNetTasks.DotNet("tool run dotnet-outdated --fail-on-updates");
});

Target Verifying => _ => _
.DependentFor(VerifyFormat, VerifyOutdated, VerifyRoslyn, VerifySonarqube)
.Unlisted();

Target Verify => _ => _
.DependsOn(VerifyFormat, VerifyOutdated, VerifyRoslyn, VerifySonarqube);
Target Test => _ => _
.DependsOn(Lint)
.Executes(() => DotNetTasks.DotNetTest(_ => _
.SetProjectFile(TestProject.Path)
.EnableCollectCoverage()
.SetDataCollector(Constants.XUnit.CoverletCollectorName)
.SetResultsDirectory(TestResultsDirectory)
.AddRunSetting(Constants.XUnit.FormatSetting, Constants.XUnit.OpenCoverFormat)
.AddRunSetting(Constants.XUnit.IncludeSetting, TestIncludes)));

Target Sonarqube => _ => _
.Requires(() => SonarToken)
.Executes(() => SonarScannerTasks.SonarScannerBegin(_ => _
.SetOrganization(SonarOrganization)
.SetProjectKey(SonarKey)
.SetOpenCoverPaths(TestResultsGlob)
.SetToken(SonarToken)
.SetQualityGateWait(true)))
.Inherit(Test)
.Executes(() => SonarScannerTasks.SonarScannerEnd(_ => _.SetToken(SonarToken)));

Target Pack => _ => _
.DependsOn(Verify)
.Executes(() => DotNetTasks.DotNetPack(_ => _
.SetProject(Solution.ArwynFr_IntegrationTesting)
.SetProperty("Version", OctoVersionInfo.FullSemVer)
Expand All @@ -110,22 +85,21 @@ class Build : NukeBuild
.SetOutputDirectory(RootDirectory)));

Target Publish => _ => _
.DependsOn(Pack)
.Requires(() => NugetApikey)
.Executes(() => DotNetTasks.DotNetNuGetPush(_ => _
.SetSource(Constants.Nuget.DefaultNugetSource)
.SetApiKey(NugetApikey)
.SetTargetPath(NugetGlob)));

Target Release => _ => _
.Unlisted()
.TriggeredBy(Publish)
.Requires(() => GhToken)
.Executes(() => Gh.Invoke(
arguments: $"release create {OctoVersionInfo.FullSemVer} --generate-notes",
environmentVariables: EnvironmentInfo.Variables
.ToDictionary(x => x.Key, x => x.Value)
.SetKeyValue("GH_TOKEN", GhToken).AsReadOnly()));
.DependsOn(Pack, Sonarqube)
.Requires(() => NugetApikey, () => GhToken)
.Executes(() =>
{
DotNetTasks.DotNetNuGetPush(_ => _
.SetSource(Constants.Nuget.DefaultNugetSource)
.SetApiKey(NugetApikey)
.SetTargetPath(NugetGlob));

Gh.Invoke(
arguments: $"release create {OctoVersionInfo.FullSemVer} --generate-notes",
environmentVariables: EnvironmentInfo.Variables
.ToDictionary(x => x.Key, x => x.Value)
.SetKeyValue("GH_TOKEN", GhToken).AsReadOnly());
});

Target Tags => _ => _
.Unlisted()
Expand Down
13 changes: 0 additions & 13 deletions build/Configuration.cs

This file was deleted.

2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageDownload Include="dotnet-sonarscanner" Version="[6.1.0]" />
<PackageDownload Include="dotnet-sonarscanner" Version="[8.0.0]" />
<PackageDownload Include="Octopus.OctoVersion.Tool" Version="[0.3.325]" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "8.0.303"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

namespace ArwynFr.IntegrationTesting.Tests.Target;

[ApiController]
[ApiController, Route("/api/entities")]
public class DummyController(DummyDbContext dbContext) : ControllerBase
{
private readonly DummyDbContext _dbContext = dbContext;

[HttpGet("/api/entities/{name}")]
[HttpGet("{name}")]
public async Task<Results<Ok<DummyEntity>, NotFound<string>>> ExecuteAsync(string name)
{
var value = await _dbContext.Entities.FirstOrDefaultAsync(entity => entity.Name == name);
Expand Down
7 changes: 5 additions & 2 deletions test/ArwynFr.IntegrationTesting.Tests.Target/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
await Task.Delay(TimeSpan.FromMilliseconds(10));
});
app.MapControllers();
app.Run();
await app.RunAsync();

public partial class Program;
public partial class Program
{
protected Program() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down