diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4f38493c..28d08446 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -61,6 +61,7 @@ jobs:
6.0
7.0
9.0
+ 10.0
- name: Cache Tools
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
diff --git a/global.json b/global.json
index b7bbcb26..45f72329 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "9.0.306",
+ "version": "10.0.100",
"rollForward": "latestFeature"
}
}
diff --git a/src/Cake.AzurePipelines.Module/AzurePipelinesReportPrinter.cs b/src/Cake.AzurePipelines.Module/AzurePipelinesReportPrinter.cs
index 9d81ce10..6d9fd80b 100644
--- a/src/Cake.AzurePipelines.Module/AzurePipelinesReportPrinter.cs
+++ b/src/Cake.AzurePipelines.Module/AzurePipelinesReportPrinter.cs
@@ -1,8 +1,10 @@
-using System;
+using System;
using System.IO;
+using System.Linq;
using System.Text;
using Cake.Common.Build;
using Cake.Core;
+using Cake.Core.Diagnostics;
using Cake.Core.IO;
using Cake.Module.Shared;
using JetBrains.Annotations;
@@ -53,6 +55,8 @@ public override void Write(CakeReport report)
private void WriteToMarkdown(CakeReport report)
{
+ var includeSkippedReasonColumn = report.Any(r => !string.IsNullOrEmpty(r.SkippedMessage));
+
var maxTaskNameLength = 29;
foreach (var item in report)
{
@@ -67,13 +71,30 @@ private void WriteToMarkdown(CakeReport report)
var sb = new StringBuilder();
sb.AppendLine("");
- sb.AppendLine("|Task|Duration|");
- sb.AppendLine("|:---|-------:|");
+
+ if (includeSkippedReasonColumn)
+ {
+ sb.AppendLine("|Task|Duration|Status|Skip Reason|");
+ sb.AppendLine("|:---|-------:|:-----|:----------|");
+ }
+ else
+ {
+ sb.AppendLine("|Task|Duration|Status|");
+ sb.AppendLine("|:---|-------:|:-----|");
+ }
+
foreach (var item in report)
{
if (ShouldWriteTask(item))
{
- sb.AppendLine(string.Format(lineFormat, item.TaskName, FormatDuration(item)));
+ if (includeSkippedReasonColumn)
+ {
+ sb.AppendLine(string.Format(lineFormat, item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus(), item.SkippedMessage));
+ }
+ else
+ {
+ sb.AppendLine(string.Format(lineFormat, item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus()));
+ }
}
}
diff --git a/src/Cake.AzurePipelines.Module/Cake.AzurePipelines.Module.csproj b/src/Cake.AzurePipelines.Module/Cake.AzurePipelines.Module.csproj
index b023fbb3..884f6b15 100644
--- a/src/Cake.AzurePipelines.Module/Cake.AzurePipelines.Module.csproj
+++ b/src/Cake.AzurePipelines.Module/Cake.AzurePipelines.Module.csproj
@@ -12,8 +12,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.BuildSystems.Module/Cake.BuildSystems.Module.csproj b/src/Cake.BuildSystems.Module/Cake.BuildSystems.Module.csproj
index d33193f4..1f01a3fa 100644
--- a/src/Cake.BuildSystems.Module/Cake.BuildSystems.Module.csproj
+++ b/src/Cake.BuildSystems.Module/Cake.BuildSystems.Module.csproj
@@ -58,7 +58,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.GitHubActions.Module/Cake.GitHubActions.Module.csproj b/src/Cake.GitHubActions.Module/Cake.GitHubActions.Module.csproj
index 00a15f4d..3e45380a 100644
--- a/src/Cake.GitHubActions.Module/Cake.GitHubActions.Module.csproj
+++ b/src/Cake.GitHubActions.Module/Cake.GitHubActions.Module.csproj
@@ -12,8 +12,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.GitHubActions.Module/GitHubActionsModule.cs b/src/Cake.GitHubActions.Module/GitHubActionsModule.cs
index 4816d7d2..da21d5f6 100644
--- a/src/Cake.GitHubActions.Module/GitHubActionsModule.cs
+++ b/src/Cake.GitHubActions.Module/GitHubActionsModule.cs
@@ -1,4 +1,4 @@
-using Cake.Core;
+using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.Composition;
using Cake.Core.Diagnostics;
@@ -22,6 +22,7 @@ public void Register(ICakeContainerRegistrar registrar)
registrar.RegisterType().As().Singleton();
registrar.RegisterType().As().Singleton();
+ registrar.RegisterType().As().Singleton();
}
}
}
diff --git a/src/Cake.GitHubActions.Module/GitHubActionsReportPrinter.cs b/src/Cake.GitHubActions.Module/GitHubActionsReportPrinter.cs
new file mode 100644
index 00000000..f761d25e
--- /dev/null
+++ b/src/Cake.GitHubActions.Module/GitHubActionsReportPrinter.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Linq;
+using System.Text;
+using Cake.Common.Build;
+using Cake.Core;
+using Cake.Core.Diagnostics;
+using Cake.Module.Shared;
+using JetBrains.Annotations;
+
+namespace Cake.GitHubActions.Module
+{
+ ///
+ /// The GitHub Actions report printer.
+ ///
+ [UsedImplicitly]
+ public class GitHubActionsReportPrinter : CakeReportPrinterBase
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The console.
+ /// The context.
+ public GitHubActionsReportPrinter(IConsole console, ICakeContext context)
+ : base(console, context)
+ {
+ }
+
+ ///
+ public override void Write(CakeReport report)
+ {
+ if (report == null)
+ {
+ throw new ArgumentNullException(nameof(report));
+ }
+
+ try
+ {
+ if (_context.GitHubActions().IsRunningOnGitHubActions)
+ {
+ WriteToMarkdown(report);
+ }
+
+ WriteToConsole(report);
+ }
+ finally
+ {
+ _console.ResetColor();
+ }
+ }
+
+ ///
+ public override void WriteLifeCycleStep(string name, Verbosity verbosity)
+ {
+ // Intentionally left blank
+ }
+
+ ///
+ public override void WriteSkippedStep(string name, Verbosity verbosity)
+ {
+ // Intentionally left blank
+ }
+
+ ///
+ public override void WriteStep(string name, Verbosity verbosity)
+ {
+ // Intentionally left blank
+ }
+
+ private void WriteToMarkdown(CakeReport report)
+ {
+ var includeSkippedReasonColumn = report.Any(r => !string.IsNullOrEmpty(r.SkippedMessage));
+
+ var sb = new StringBuilder();
+ sb.AppendLine(string.Empty);
+
+ if (includeSkippedReasonColumn)
+ {
+ sb.AppendLine("|Task|Duration|Status|Skip Reason|");
+ sb.AppendLine("|----|--------|------|-----------|");
+ }
+ else
+ {
+ sb.AppendLine("|Task|Duration|Status|");
+ sb.AppendLine("|----|--------|------|");
+ }
+
+ foreach (var item in report)
+ {
+ if (ShouldWriteTask(item))
+ {
+ if (includeSkippedReasonColumn)
+ {
+ sb.AppendLine(string.Format("|{0}|{1}|{2}|{3}|", item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus(), item.SkippedMessage));
+ }
+ else
+ {
+ sb.AppendLine(string.Format("|{0}|{1}|{2}|", item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus()));
+ }
+ }
+ }
+
+ if (includeSkippedReasonColumn)
+ {
+ sb.AppendLine("|||||");
+ sb.AppendLine(string.Format("|**_{0}_**|**_{1}_**|||", "Total:", GetTotalTime(report)));
+ }
+ else
+ {
+ sb.AppendLine("||||");
+ sb.AppendLine(string.Format("|**_{0}_**|**_{1}_**||", "Total:", GetTotalTime(report)));
+ }
+
+ _context.GitHubActions().Commands.SetStepSummary(sb.ToString());
+ }
+ }
+}
diff --git a/src/Cake.GitLabCI.Module/Cake.GitLabCI.Module.csproj b/src/Cake.GitLabCI.Module/Cake.GitLabCI.Module.csproj
index 46b29734..5d91e8f5 100644
--- a/src/Cake.GitLabCI.Module/Cake.GitLabCI.Module.csproj
+++ b/src/Cake.GitLabCI.Module/Cake.GitLabCI.Module.csproj
@@ -12,8 +12,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.Module.Shared/Cake.Module.Shared.csproj b/src/Cake.Module.Shared/Cake.Module.Shared.csproj
index 174892a2..adf5ef57 100644
--- a/src/Cake.Module.Shared/Cake.Module.Shared.csproj
+++ b/src/Cake.Module.Shared/Cake.Module.Shared.csproj
@@ -8,8 +8,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.Module.Shared/CakeReportPrinterBase.cs b/src/Cake.Module.Shared/CakeReportPrinterBase.cs
index b2c952d6..c2d4e78d 100644
--- a/src/Cake.Module.Shared/CakeReportPrinterBase.cs
+++ b/src/Cake.Module.Shared/CakeReportPrinterBase.cs
@@ -63,6 +63,8 @@ public virtual void WriteSkippedStep(string name, Verbosity verbosity)
/// The report to write.
protected void WriteToConsole(CakeReport report)
{
+ var includeSkippedReasonColumn = report.Any(r => !string.IsNullOrEmpty(r.SkippedMessage));
+
var maxTaskNameLength = 29;
foreach (var item in report)
{
@@ -78,7 +80,14 @@ protected void WriteToConsole(CakeReport report)
// Write header.
_console.WriteLine();
- _console.WriteLine(lineFormat, "Task", "Duration");
+ if (includeSkippedReasonColumn)
+ {
+ _console.WriteLine(lineFormat, "Task", "Duration", "Status", "Skip Reason");
+ }
+ else
+ {
+ _console.WriteLine(lineFormat, "Task", "Duration", "Status");
+ }
_console.WriteLine(new string('-', 20 + maxTaskNameLength));
// Write task status.
@@ -87,7 +96,14 @@ protected void WriteToConsole(CakeReport report)
if (ShouldWriteTask(item))
{
_console.ForegroundColor = GetItemForegroundColor(item);
- _console.WriteLine(lineFormat, item.TaskName, FormatDuration(item));
+ if (includeSkippedReasonColumn)
+ {
+ _console.WriteLine(lineFormat, item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus(), item.SkippedMessage);
+ }
+ else
+ {
+ _console.WriteLine(lineFormat, item.TaskName, FormatDuration(item), item.ExecutionStatus.ToReportStatus());
+ }
}
}
@@ -142,7 +158,7 @@ protected static string FormatDuration(CakeReportEntry item)
{
if (item.ExecutionStatus == CakeTaskExecutionStatus.Skipped)
{
- return "Skipped";
+ return "-";
}
return FormatTime(item.Duration);
diff --git a/src/Cake.MyGet.Module/Cake.MyGet.Module.csproj b/src/Cake.MyGet.Module/Cake.MyGet.Module.csproj
index 9eb9563b..1a55b26e 100644
--- a/src/Cake.MyGet.Module/Cake.MyGet.Module.csproj
+++ b/src/Cake.MyGet.Module/Cake.MyGet.Module.csproj
@@ -12,8 +12,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.TeamCity.Module/Cake.TeamCity.Module.csproj b/src/Cake.TeamCity.Module/Cake.TeamCity.Module.csproj
index 9e7ee421..06c1a212 100644
--- a/src/Cake.TeamCity.Module/Cake.TeamCity.Module.csproj
+++ b/src/Cake.TeamCity.Module/Cake.TeamCity.Module.csproj
@@ -12,8 +12,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Cake.TravisCI.Module/Cake.TravisCI.Module.csproj b/src/Cake.TravisCI.Module/Cake.TravisCI.Module.csproj
index 3eed34b2..b0edf2b9 100644
--- a/src/Cake.TravisCI.Module/Cake.TravisCI.Module.csproj
+++ b/src/Cake.TravisCI.Module/Cake.TravisCI.Module.csproj
@@ -12,8 +12,8 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive