Merge pull request #127 from Biarity/fix-pipeline

Trigger GitAction on pull requests
This commit is contained in:
ITDancer13 2021-05-14 13:46:45 +02:00 committed by GitHub
commit 108f20f956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 15 deletions

View File

@ -20,6 +20,9 @@ on:
push: push:
branches: branches:
- master - master
pull_request:
branches:
- master
jobs: jobs:
ubuntu-latest: ubuntu-latest:

View File

@ -15,29 +15,23 @@ using static Nuke.Common.Tools.DotNet.DotNetTasks;
[ShutdownDotNetAfterServerBuild] [ShutdownDotNetAfterServerBuild]
[GitHubActions("ci", GitHubActionsImage.UbuntuLatest, [GitHubActions("ci", GitHubActionsImage.UbuntuLatest,
OnPushBranches = new[] {"master"}, OnPushBranches = new[] {"master"},
OnPullRequestBranches = new[] {"master"},
AutoGenerate = true, AutoGenerate = true,
InvokedTargets = new[] {nameof(Ci)}, InvokedTargets = new[] {nameof(Ci)},
CacheKeyFiles = new string[0])] CacheKeyFiles = new string[0])]
class Build : NukeBuild class Build : NukeBuild
{ {
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode
public static int Main() => Execute<Build>(x => x.Package);
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
[Solution] readonly Solution Solution;
Project SieveProject => Solution.AllProjects.First(p => p.Name == "Sieve");
[GitRepository] readonly GitRepository GitRepository; [GitRepository] readonly GitRepository GitRepository;
[GitVersion(Framework = "netcoreapp3.1")] readonly GitVersion GitVersion; [GitVersion(Framework = "netcoreapp3.1")] readonly GitVersion GitVersion;
[Solution] readonly Solution Solution;
Project SieveProject => Solution.AllProjects.First(p => p.Name == "Sieve");
AbsolutePath OutputDirectory => RootDirectory / "output"; AbsolutePath OutputDirectory => RootDirectory / "output";
Target Clean => _ => _ Target Clean => _ => _
@ -73,9 +67,7 @@ class Build : NukeBuild
.Executes(() => .Executes(() =>
{ {
DotNetTest(s => s DotNetTest(s => s
.SetProjectFile(Solution) .SetProjectFile(Solution));
.EnableNoRestore()
.EnableNoBuild());
}); });
Target Package => _ => _ Target Package => _ => _
@ -93,4 +85,11 @@ class Build : NukeBuild
Target Ci => _ => _ Target Ci => _ => _
.DependsOn(Package); .DependsOn(Package);
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode
public static int Main() => Execute<Build>(x => x.Package);
} }