mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Build adjustments for code annotation (#2155)
* Drop special formatting, allowing annotations to work properly. * Suppress duplicate warnings, adding a prefix to prevent annotation * Tweak message, don't rebuild on test * Move testing into same job step * Only run PR build on newly opened PRs * flip build order, derp * Test suppressing summary for annotations... * Get the build order right, testing without conditionals... * Run tests after compile, suppress warnings from test * Reverted previous change to `main.yml`. * Drop special formatting, allowing annotations to work properly. * Suppress duplicate warnings, adding a prefix to prevent annotation * Tweak message, don't rebuild on test * Move testing into same job step * Only run PR build on newly opened PRs * flip build order, derp * Test suppressing summary for annotations... * Get the build order right, testing without conditionals... * Run tests after compile, suppress warnings from test * Reverted previous change to `main.yml`. * Drop special formatting, allowing annotations to work properly. * Suppress duplicate warnings, adding a prefix to prevent annotation * Tweak message, don't rebuild on test * Move testing into same job step * Only run PR build on newly opened PRs * flip build order, derp * Test suppressing summary for annotations... * Get the build order right, testing without conditionals... * Run tests after compile, suppress warnings from test * Reverted previous change to `main.yml`. * Add conditional for CI builds, add --skip-tests to make up for the combined build/test step. * Behavior change, now requires arg `ci` to be passed to trigger tests. Tests can also be manually triggered with `test`.
This commit is contained in:
parent
2c00bf5b21
commit
203d80c602
3 changed files with 50 additions and 21 deletions
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
|
|
@ -1,5 +1,6 @@
|
||||||
name: Build Dalamud
|
name: Build Dalamud
|
||||||
on: [push, pull_request, workflow_dispatch]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: build_dalamud_${{ github.ref_name }}
|
group: build_dalamud_${{ github.ref_name }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
@ -32,10 +33,8 @@ jobs:
|
||||||
($env:REPO_NAME) >> VERSION
|
($env:REPO_NAME) >> VERSION
|
||||||
($env:BRANCH) >> VERSION
|
($env:BRANCH) >> VERSION
|
||||||
($env:COMMIT) >> VERSION
|
($env:COMMIT) >> VERSION
|
||||||
- name: Build Dalamud
|
- name: Build and Test Dalamud
|
||||||
run: .\build.ps1 compile
|
run: .\build.ps1 ci
|
||||||
- name: Test Dalamud
|
|
||||||
run: .\build.ps1 test
|
|
||||||
- name: Sign Dalamud
|
- name: Sign Dalamud
|
||||||
if: ${{ github.repository_owner == 'goatcorp' && github.event_name == 'push' }}
|
if: ${{ github.repository_owner == 'goatcorp' && github.event_name == 'push' }}
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"CI",
|
||||||
"Clean",
|
"Clean",
|
||||||
"Compile",
|
"Compile",
|
||||||
"CompileCImGui",
|
"CompileCImGui",
|
||||||
|
|
@ -88,6 +89,7 @@
|
||||||
"CompileInjector",
|
"CompileInjector",
|
||||||
"CompileInjectorBoot",
|
"CompileInjectorBoot",
|
||||||
"Restore",
|
"Restore",
|
||||||
|
"SetCILogging",
|
||||||
"Test"
|
"Test"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -102,6 +104,7 @@
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
"CI",
|
||||||
"Clean",
|
"Clean",
|
||||||
"Compile",
|
"Compile",
|
||||||
"CompileCImGui",
|
"CompileCImGui",
|
||||||
|
|
@ -114,6 +117,7 @@
|
||||||
"CompileInjector",
|
"CompileInjector",
|
||||||
"CompileInjectorBoot",
|
"CompileInjectorBoot",
|
||||||
"Restore",
|
"Restore",
|
||||||
|
"SetCILogging",
|
||||||
"Test"
|
"Test"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Nuke.Common;
|
using Nuke.Common;
|
||||||
|
|
@ -5,6 +6,7 @@ using Nuke.Common.Execution;
|
||||||
using Nuke.Common.Git;
|
using Nuke.Common.Git;
|
||||||
using Nuke.Common.IO;
|
using Nuke.Common.IO;
|
||||||
using Nuke.Common.ProjectModel;
|
using Nuke.Common.ProjectModel;
|
||||||
|
using Nuke.Common.Tooling;
|
||||||
using Nuke.Common.Tools.DotNet;
|
using Nuke.Common.Tools.DotNet;
|
||||||
using Nuke.Common.Tools.MSBuild;
|
using Nuke.Common.Tools.MSBuild;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
@ -61,6 +63,9 @@ public class DalamudBuild : NukeBuild
|
||||||
|
|
||||||
private static Dictionary<string, string> EnvironmentVariables => new(EnvironmentInfo.Variables);
|
private static Dictionary<string, string> EnvironmentVariables => new(EnvironmentInfo.Variables);
|
||||||
|
|
||||||
|
private static string ConsoleTemplate => "{Message:l}{NewLine}{Exception}";
|
||||||
|
private static bool IsCIBuild => Environment.GetEnvironmentVariable("CI") == "true";
|
||||||
|
|
||||||
Target Restore => _ => _
|
Target Restore => _ => _
|
||||||
.Executes(() =>
|
.Executes(() =>
|
||||||
{
|
{
|
||||||
|
|
@ -123,16 +128,20 @@ public class DalamudBuild : NukeBuild
|
||||||
.SetProjectFile(DalamudProjectFile)
|
.SetProjectFile(DalamudProjectFile)
|
||||||
.SetConfiguration(Configuration)
|
.SetConfiguration(Configuration)
|
||||||
.EnableNoRestore();
|
.EnableNoRestore();
|
||||||
|
if (IsCIBuild)
|
||||||
|
{
|
||||||
|
s = s
|
||||||
|
.SetProcessArgumentConfigurator(a => a.Add("/clp:NoSummary")); // Disable MSBuild summary on CI builds
|
||||||
|
}
|
||||||
// We need to emit compiler generated files for the docs build, since docfx can't run generators directly
|
// We need to emit compiler generated files for the docs build, since docfx can't run generators directly
|
||||||
// TODO: This fails every build after this because of redefinitions...
|
// TODO: This fails every build after this because of redefinitions...
|
||||||
|
|
||||||
// if (IsDocsBuild)
|
// if (IsDocsBuild)
|
||||||
// {
|
// {
|
||||||
// Log.Warning("Building for documentation, emitting compiler generated files. This can cause issues on Windows due to path-length limitations");
|
// Log.Warning("Building for documentation, emitting compiler generated files. This can cause issues on Windows due to path-length limitations");
|
||||||
// s = s
|
// s = s
|
||||||
// .SetProperty("IsDocsBuild", "true");
|
// .SetProperty("IsDocsBuild", "true");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -171,12 +180,28 @@ public class DalamudBuild : NukeBuild
|
||||||
.SetConfiguration(Configuration));
|
.SetConfiguration(Configuration));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Target SetCILogging => _ => _
|
||||||
|
.DependentFor(Compile)
|
||||||
|
.OnlyWhenStatic(() => IsCIBuild)
|
||||||
|
.Executes(() =>
|
||||||
|
{
|
||||||
|
Log.Logger = new LoggerConfiguration()
|
||||||
|
.MinimumLevel.Debug()
|
||||||
|
.WriteTo.Console(outputTemplate: ConsoleTemplate)
|
||||||
|
.CreateLogger();
|
||||||
|
});
|
||||||
|
|
||||||
Target Compile => _ => _
|
Target Compile => _ => _
|
||||||
.DependsOn(CompileDalamud)
|
.DependsOn(CompileDalamud)
|
||||||
.DependsOn(CompileDalamudBoot)
|
.DependsOn(CompileDalamudBoot)
|
||||||
.DependsOn(CompileDalamudCrashHandler)
|
.DependsOn(CompileDalamudCrashHandler)
|
||||||
.DependsOn(CompileInjector)
|
.DependsOn(CompileInjector)
|
||||||
.DependsOn(CompileInjectorBoot);
|
.DependsOn(CompileInjectorBoot)
|
||||||
|
;
|
||||||
|
|
||||||
|
Target CI => _ => _
|
||||||
|
.DependsOn(Compile)
|
||||||
|
.Triggers(Test);
|
||||||
|
|
||||||
Target Test => _ => _
|
Target Test => _ => _
|
||||||
.DependsOn(Compile)
|
.DependsOn(Compile)
|
||||||
|
|
@ -185,6 +210,7 @@ public class DalamudBuild : NukeBuild
|
||||||
DotNetTasks.DotNetTest(s => s
|
DotNetTasks.DotNetTest(s => s
|
||||||
.SetProjectFile(TestProjectFile)
|
.SetProjectFile(TestProjectFile)
|
||||||
.SetConfiguration(Configuration)
|
.SetConfiguration(Configuration)
|
||||||
|
.AddProperty("WarningLevel", "0")
|
||||||
.EnableNoRestore());
|
.EnableNoRestore());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue