Skip to content

Commit

Permalink
💚 CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Nov 14, 2024
1 parent bb07a4a commit 3913d03
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ jobs:
run: dotnet --info

- name: Build tools
run: dotnet build -c Release src\Tools.Build\Tools.Build.csproj --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none -p:GeneratePackageOnBuild=false /nowarn:MSB4011,NU5048,NU5104
run: dotnet build -c Release src\Tools.Build\Tools.Build.csproj --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none -p:GeneratePackageOnBuild=false

- name: Test projects
run: .\src\artifacts\bin\Tools.Build\release\Tools.Build.exe build --test

- name: UnitTest(Debug)
run: dotnet test src/BD.Common8.UnitTest/BD.Common8.UnitTest.csproj -c Debug -p:GeneratePackageOnBuild=false -p:AnalysisLevel=none --nologo -v q /property:WarningLevel=0 --logger:"trx;LogFilePrefix=testResults" /nowarn:MSB4011,NU5048,NU5104
run: dotnet test src/BD.Common8.UnitTest/BD.Common8.UnitTest.csproj -c Debug -p:GeneratePackageOnBuild=false -p:AnalysisLevel=none --nologo -v q /property:WarningLevel=0 --logger:"trx;LogFilePrefix=testResults"

- name: UnitTest(Release)
run: dotnet test src/BD.Common8.UnitTest/BD.Common8.UnitTest.csproj -c Release -p:GeneratePackageOnBuild=false -p:AnalysisLevel=none --nologo -v q /property:WarningLevel=0 --logger:"trx;LogFilePrefix=testResults" /nowarn:MSB4011,NU5048,NU5104
run: dotnet test src/BD.Common8.UnitTest/BD.Common8.UnitTest.csproj -c Release -p:GeneratePackageOnBuild=false -p:AnalysisLevel=none --nologo -v q /property:WarningLevel=0 --logger:"trx;LogFilePrefix=testResults"

build:
name: Build
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
run: dotnet --info

- name: Build tools
run: dotnet build -c Release src\Tools.Build\Tools.Build.csproj --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none -p:GeneratePackageOnBuild=false /nowarn:MSB4011,NU5048,NU5104
run: dotnet build -c Release src\Tools.Build\Tools.Build.csproj --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none -p:GeneratePackageOnBuild=false

- name: Build projects
run: .\src\artifacts\bin\Tools.Build\release\Tools.Build.exe build
Expand Down
3 changes: 1 addition & 2 deletions src/Sdk/Global.Base.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<UseArtifactsOutput Condition="!Exists('$(MSBuildThisFileDirectory)..\..\..\.nupkg.metadata')">true</UseArtifactsOutput>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<NoWarn>$(NoWarn);NU1504;NU1507;MSB4011</NoWarn>
<NoWarn>$(NoWarn);NU1504;NU1507;MSB4011;NU5048;NU5104</NoWarn>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<ImplicitUsings Condition="!$(TargetFramework.StartsWith('net35'))">true</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn),MSB4011,NU5048,NU5104</NoWarn>
</PropertyGroup>

<!-- 👇 全局 using | Global usings -->
Expand Down
2 changes: 1 addition & 1 deletion src/Tools.Build/Commands/IBuildCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async ValueTask Handler(string projectName, string config, bool test, Cancellati
ProcessStartInfo psi = new()
{
FileName = "dotnet",
Arguments = $"build -c {config} {projectName}.csproj --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none{(test ? " -p:GeneratePackageOnBuild=false" : "")} /nowarn:MSB4011,NU5048,NU5104{(maxcpucount == 0 ? " -maxcpucount" : (maxcpucount > 0 && maxcpucount <= Math.Max(Environment.ProcessorCount, 2) ? $"-maxcpucount:{maxcpucount}" : ""))}",
Arguments = $"build -c {config} {projectName}.csproj --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none{(test ? " -p:GeneratePackageOnBuild=false" : "")}{(maxcpucount == 0 ? " -maxcpucount" : (maxcpucount > 0 && maxcpucount <= Math.Max(Environment.ProcessorCount, 2) ? $"-maxcpucount:{maxcpucount}" : ""))}",
WorkingDirectory = projPath,
};
var process = Process.Start(psi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static async Task<int> Handler(string path)
ProcessStartInfo psi = new()
{
FileName = "dotnet",
Arguments = $"build -c Release {csprojFilePath} --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none -p:GeneratePackageOnBuild=false /nowarn:MSB4011,NU5048,NU5104 -maxcpucount",
Arguments = $"build -c Release {csprojFilePath} --nologo -v q /property:WarningLevel=0 -p:AnalysisLevel=none -p:GeneratePackageOnBuild=false",
WorkingDirectory = ROOT_ProjPath,
};
var process = Process.Start(psi);
Expand Down
2 changes: 0 additions & 2 deletions src/Tools.Build/Commands/IServerPublishCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ private static async Task Publish(string projPath, ServerPublishConfig config, s
psi.ArgumentList.Add("-p:DebugSymbols=false");
psi.ArgumentList.Add("-p:IsPackable=false");
psi.ArgumentList.Add("-p:GenerateDocumentationFile=false");
psi.ArgumentList.Add("/nowarn:MSB4011,NU5048,NU5104");
psi.ArgumentList.Add("-maxcpucount");

psi.ArgumentList.Add("-o");
psi.ArgumentList.Add(publishPath);
Expand Down
2 changes: 2 additions & 0 deletions src/Tools.Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
ToArray();
Array.ForEach(commands, m => m.Invoke(null, [rootCommand,]));
var exitCode = await rootCommand.InvokeAsync(args);
Console.Write("exitCode: ");
Console.WriteLine(exitCode);
return exitCode;
}
catch (Exception ex)
Expand Down

0 comments on commit 3913d03

Please sign in to comment.