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/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"; + } +} 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"; + } +} 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"; + } +} 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"; + } +} 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 + { } +}