From 4ff2c0899b92281031d9420e82e2836a471a035b Mon Sep 17 00:00:00 2001 From: Mabrouk Mahdhi Date: Fri, 24 Jan 2025 01:43:33 +0100 Subject: [PATCH 1/5] DATA: InstallPlaywrightTask --- .../DotNets/Tasks/InstallPlaywrightTask.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs new file mode 100644 index 0000000..607861c --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs @@ -0,0 +1,13 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + public class InstallPlaywrightTask : GithubTask + { + public override string Run { get; set; } = "dotnet tool install --global Microsoft.Playwright.CLI"; + } +} From f7a12d1d32932afc0bdf47bea865a2774344c82d Mon Sep 17 00:00:00 2001 From: Mabrouk Mahdhi Date: Fri, 24 Jan 2025 01:46:04 +0100 Subject: [PATCH 2/5] DATA: WorkloadUpdateTask --- .../DotNets/Tasks/WorkloadUpdateTask.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs new file mode 100644 index 0000000..f5c02cc --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs @@ -0,0 +1,13 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + public class WorkloadUpdateTask : GithubTask + { + public override string Run { get; set; } = "dotnet workload update"; + } +} From 3217e27136dc07e044a6763d36b0573c80150fa8 Mon Sep 17 00:00:00 2001 From: Mabrouk Mahdhi Date: Fri, 24 Jan 2025 01:56:10 +0100 Subject: [PATCH 3/5] DATA: InstallPlaywrightBrowsersTask --- .../Tasks/InstallPlaywrightBrowsersTask.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs new file mode 100644 index 0000000..a7a4c97 --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs @@ -0,0 +1,17 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +using YamlDotNet.Serialization; + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + public class InstallPlaywrightBrowsersTask : GithubTask + { + [YamlIgnore] + public string ProjectName { get; set; } + public override string Run => $"pwsh ./{ProjectName}/bin/Debug/net9.0/playwright.ps1 install"; + } +} From 50db6ba71efd7b298607e1249e63ee92abdd43c4 Mon Sep 17 00:00:00 2001 From: Mabrouk Mahdhi Date: Fri, 24 Jan 2025 02:02:12 +0100 Subject: [PATCH 4/5] DATA: RunUntilFailureTask --- .../DotNets/Tasks/RunUntilFailureTask.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/RunUntilFailureTask.cs diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/RunUntilFailureTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/RunUntilFailureTask.cs new file mode 100644 index 0000000..85417ad --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/RunUntilFailureTask.cs @@ -0,0 +1,21 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +using YamlDotNet.Serialization; + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + public class RunUntilFailureTask : GithubTask + { + [YamlMember(Order = 1, Alias = "shell", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] + public override string Shell => "bash"; + + [YamlMember(Order = 2, Alias = "run", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] + public override string Run => "for i in {1..1000};" + + @" do echo ""Run #$i""; dotnet test --no-build " + + "--verbosity normal --filter 'FullyQualifiedName!~Integrations' || exit 1; done"; + } +} From a062501ec9dfb1a9bf9c2fc7811dfb119176b145 Mon Sep 17 00:00:00 2001 From: Mabrouk Mahdhi Date: Fri, 24 Jan 2025 02:12:52 +0100 Subject: [PATCH 5/5] DATA: EventsV2 --- .../GithubPipelines/DotNets/EventsV2.cs | 24 +++++++++++++++++++ .../GithubPipelines/DotNets/ScheduledEvent.cs | 16 +++++++++++++ .../DotNets/WorkflowDispatchEvent.cs | 11 +++++++++ 3 files changed, 51 insertions(+) create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/EventsV2.cs create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/ScheduledEvent.cs create mode 100644 ADotNet/Models/Pipelines/GithubPipelines/DotNets/WorkflowDispatchEvent.cs diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/EventsV2.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/EventsV2.cs new file mode 100644 index 0000000..833a7e9 --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/EventsV2.cs @@ -0,0 +1,24 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +using YamlDotNet.Serialization; + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets +{ + public class EventsV2 + { + [YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] + public PushEvent Push { get; set; } + + [YamlMember(Alias = "pull_request", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] + public PullRequestEvent PullRequest { get; set; } + + public ScheduledEvent[] Schedule { get; set; } + + [YamlMember(Alias = "workflow_dispatch")] + public WorkflowDispatchEvent WorkflowDispatch { get; set; } + } +} diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/ScheduledEvent.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/ScheduledEvent.cs new file mode 100644 index 0000000..4d9ecfa --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/ScheduledEvent.cs @@ -0,0 +1,16 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +using YamlDotNet.Serialization; + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets +{ + public class ScheduledEvent + { + [YamlMember(Order = 0, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)] + public string Cron { get; set; } + } +} diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/WorkflowDispatchEvent.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/WorkflowDispatchEvent.cs new file mode 100644 index 0000000..923778a --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/WorkflowDispatchEvent.cs @@ -0,0 +1,11 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets +{ + public class WorkflowDispatchEvent + { } +}