Пример #1
0
        protected virtual GitHubActionsConfiguration GetConfiguration(NukeBuild targets, IReadOnlyCollection <ExecutableTarget> relevantTargets)
        {
            var configuration = new GitHubActionsConfiguration
            {
                Name             = _name,
                ShortTriggers    = On,
                DetailedTriggers = GetTriggers().ToArray(),
                Jobs             = _images.Select(x => GetJobs(x, relevantTargets)).ToArray()
            };

            ControlFlow.Assert(configuration.ShortTriggers == null || configuration.DetailedTriggers.Length == 0,
                               "configuration.ShortTriggers == null || configuration.DetailedTriggers.Length == 0");

            return(configuration);
        }
Пример #2
0
        public override ConfigurationEntity GetConfiguration(
            NukeBuild build,
            IReadOnlyCollection <ExecutableTarget> relevantTargets)
        {
            var configuration = new GitHubActionsConfiguration
            {
                Name             = _name,
                ShortTriggers    = On,
                DetailedTriggers = GetTriggers().ToArray(),
                Jobs             = _images.Select(x => GetJobs(x, relevantTargets)).ToArray()
            };

            ControlFlow.Assert(configuration.ShortTriggers.Length == 0 || configuration.DetailedTriggers.Length == 0,
                               $"Workflows can only define either shorthand '{On}' or '{On}*' triggers.");
            ControlFlow.Assert(configuration.ShortTriggers.Length > 0 || configuration.DetailedTriggers.Length > 0,
                               "Workflows must define either shorthand '{On}' or '{On}*' triggers.");

            return(configuration);
        }