forked from cake-contrib/Cake.BuildSystems.Module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitHubActionsModule.cs
More file actions
28 lines (25 loc) · 963 Bytes
/
Copy pathGitHubActionsModule.cs
File metadata and controls
28 lines (25 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.Composition;
using Cake.Core.Diagnostics;
[assembly: CakeModule(typeof(Cake.GitHubActions.Module.GitHubActionsModule))]
namespace Cake.GitHubActions.Module
{
/// <summary>
/// <see cref="ICakeModule"/> implementation for GitHub Actions.
/// </summary>
public class GitHubActionsModule : ICakeModule
{
/// <inheritdoc cref="ICakeModule.Register"/>
public void Register(ICakeContainerRegistrar registrar)
{
if (string.IsNullOrWhiteSpace(System.Environment.GetEnvironmentVariable("GITHUB_ACTIONS")))
{
return;
}
registrar.RegisterType<GitHubActionsEngine>().As<ICakeEngine>().Singleton();
registrar.RegisterType<GitHubActionsLog>().As<ICakeLog>().Singleton();
registrar.RegisterType<GitHubActionsReportPrinter>().As<ICakeReportPrinter>().Singleton();
}
}
}