Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build adjustments for code annotation #2155

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a0e8a83
Drop special formatting, allowing annotations to work properly.
nathanctech Dec 24, 2024
3f803ad
Suppress duplicate warnings, adding a prefix to prevent annotation
nathanctech Dec 24, 2024
fceea19
Tweak message, don't rebuild on test
nathanctech Dec 24, 2024
2c11a39
Move testing into same job step
nathanctech Dec 24, 2024
18afb45
Only run PR build on newly opened PRs
nathanctech Dec 24, 2024
9ba0f4e
flip build order, derp
nathanctech Dec 24, 2024
349dd06
Test suppressing summary for annotations...
nathanctech Dec 24, 2024
748cd96
Get the build order right, testing without conditionals...
nathanctech Dec 24, 2024
89d4711
Run tests after compile, suppress warnings from test
nathanctech Dec 24, 2024
ad133d8
Reverted previous change to `main.yml`.
nathanctech Dec 24, 2024
9df01d1
Drop special formatting, allowing annotations to work properly.
nathanctech Dec 24, 2024
e173e45
Suppress duplicate warnings, adding a prefix to prevent annotation
nathanctech Dec 24, 2024
e0d18a9
Tweak message, don't rebuild on test
nathanctech Dec 24, 2024
a023e1d
Move testing into same job step
nathanctech Dec 24, 2024
c7ee6b0
Only run PR build on newly opened PRs
nathanctech Dec 24, 2024
9b8f637
flip build order, derp
nathanctech Dec 24, 2024
aa04419
Test suppressing summary for annotations...
nathanctech Dec 24, 2024
99d4970
Get the build order right, testing without conditionals...
nathanctech Dec 24, 2024
46984d1
Run tests after compile, suppress warnings from test
nathanctech Dec 24, 2024
470355f
Reverted previous change to `main.yml`.
nathanctech Dec 24, 2024
d512610
Drop special formatting, allowing annotations to work properly.
nathanctech Dec 24, 2024
5d4ba87
Suppress duplicate warnings, adding a prefix to prevent annotation
nathanctech Dec 24, 2024
cc17905
Tweak message, don't rebuild on test
nathanctech Dec 24, 2024
42a27c3
Move testing into same job step
nathanctech Dec 24, 2024
d9599c1
Only run PR build on newly opened PRs
nathanctech Dec 24, 2024
62362d3
flip build order, derp
nathanctech Dec 24, 2024
e1f51a3
Test suppressing summary for annotations...
nathanctech Dec 24, 2024
a6f50d8
Get the build order right, testing without conditionals...
nathanctech Dec 24, 2024
7031ff9
Run tests after compile, suppress warnings from test
nathanctech Dec 24, 2024
035f4aa
Reverted previous change to `main.yml`.
nathanctech Dec 24, 2024
ac588b5
Merge branch 'ci_annotate' of https://github.com/Era-FFXIV/Dalamud in…
nathanctech Jan 3, 2025
4d89b2c
Merge branch 'goatcorp:master' into ci_annotate
nathanctech Jan 3, 2025
105c475
Merge branch 'ci_annotate' of https://github.com/Era-FFXIV/Dalamud in…
nathanctech Jan 3, 2025
005496d
Add conditional for CI builds, add --skip-tests to make up for the co…
nathanctech Jan 3, 2025
2eb52a2
Behavior change, now requires arg `ci` to be passed to trigger tests.…
nathanctech Jan 3, 2025
f78cede
Merge branch 'master' into ci_annotate
nathanctech Jan 21, 2025
c7e32b0
Merge branch 'master' into ci_annotate
nathanctech Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build Dalamud
on: [push, pull_request, workflow_dispatch]

concurrency:
group: build_dalamud_${{ github.ref_name }}
cancel-in-progress: true
Expand Down Expand Up @@ -32,10 +33,8 @@ jobs:
($env:REPO_NAME) >> VERSION
($env:BRANCH) >> VERSION
($env:COMMIT) >> VERSION
- name: Build Dalamud
run: .\build.ps1 compile
- name: Test Dalamud
run: .\build.ps1 test
- name: Build and Test Dalamud
nathanctech marked this conversation as resolved.
Show resolved Hide resolved
run: .\build.ps1 ci
- name: Sign Dalamud
if: ${{ github.repository_owner == 'goatcorp' && github.event_name == 'push' }}
env:
Expand Down Expand Up @@ -87,9 +86,9 @@ jobs:
- name: "Verify Compatibility"
run: |
$FILES_TO_VALIDATE = "Dalamud.dll","FFXIVClientStructs.dll","Lumina.dll","Lumina.Excel.dll"

$retcode = 0

foreach ($file in $FILES_TO_VALIDATE) {
$testout = ""
Write-Output "::group::=== API COMPATIBILITY CHECK: ${file} ==="
Expand All @@ -100,7 +99,7 @@ jobs:
$retcode = 1
}
}

exit $retcode

deploy_stg:
Expand Down Expand Up @@ -129,18 +128,18 @@ jobs:
GH_BRANCH: ${{ steps.extract_branch.outputs.branch }}
run: |
Compress-Archive .\scratch\* .\canary.zip # Recreate the release zip

$branchName = $env:GH_BRANCH

if ($branchName -eq "master") {
$branchName = "stg"
}

$newVersion = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\TEMP_gitver.txt")
$revision = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\revision.txt")
$commitHash = [System.IO.File]::ReadAllText("$(Get-Location)\scratch\commit_hash.txt")
Remove-Item -Force -Recurse .\scratch

if (Test-Path -Path $branchName) {
$versionData = Get-Content ".\${branchName}\version" | ConvertFrom-Json
$oldVersion = $versionData.AssemblyVersion
Expand All @@ -159,16 +158,16 @@ jobs:
Write-Host "Deployment folder doesn't exist. Not doing anything."
Remove-Item .\canary.zip
}

- name: Commit changes
shell: bash
env:
GH_BRANCH: ${{ steps.extract_branch.outputs.branch }}
run: |
git config --global user.name "Actions User"
git config --global user.email "[email protected]"

git add .
git commit -m "[CI] Update staging for ${DVER} on ${GH_BRANCH}" || true

git push origin main || true
4 changes: 4 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"items": {
"type": "string",
"enum": [
"CI",
"Clean",
"Compile",
"CompileCImGui",
Expand All @@ -88,6 +89,7 @@
"CompileInjector",
"CompileInjectorBoot",
"Restore",
"SetCILogging",
"Test"
]
}
Expand All @@ -102,6 +104,7 @@
"items": {
"type": "string",
"enum": [
"CI",
"Clean",
"Compile",
"CompileCImGui",
Expand All @@ -114,6 +117,7 @@
"CompileInjector",
"CompileInjectorBoot",
"Restore",
"SetCILogging",
"Test"
]
}
Expand Down
40 changes: 33 additions & 7 deletions build/DalamudBuild.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using Nuke.Common;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.MSBuild;
using Serilog;
Expand Down Expand Up @@ -61,6 +63,9 @@ public class DalamudBuild : NukeBuild

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 => _ => _
.Executes(() =>
{
Expand Down Expand Up @@ -123,16 +128,20 @@ public class DalamudBuild : NukeBuild
.SetProjectFile(DalamudProjectFile)
.SetConfiguration(Configuration)
.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
// TODO: This fails every build after this because of redefinitions...

// if (IsDocsBuild)
// {
// Log.Warning("Building for documentation, emitting compiler generated files. This can cause issues on Windows due to path-length limitations");
// s = s
// .SetProperty("IsDocsBuild", "true");
// }

return s;
});
});
Expand Down Expand Up @@ -171,12 +180,28 @@ public class DalamudBuild : NukeBuild
.SetConfiguration(Configuration));
});

Target SetCILogging => _ => _
.DependentFor(Compile)
.OnlyWhenStatic(() => IsCIBuild)
.Executes(() =>
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console(outputTemplate: ConsoleTemplate)
.CreateLogger();
});

Target Compile => _ => _
.DependsOn(CompileDalamud)
.DependsOn(CompileDalamudBoot)
.DependsOn(CompileDalamudCrashHandler)
.DependsOn(CompileInjector)
.DependsOn(CompileInjectorBoot);
.DependsOn(CompileDalamud)
.DependsOn(CompileDalamudBoot)
.DependsOn(CompileDalamudCrashHandler)
.DependsOn(CompileInjector)
.DependsOn(CompileInjectorBoot)
;

Target CI => _ => _
.DependsOn(Compile)
.Triggers(Test);

Target Test => _ => _
.DependsOn(Compile)
Expand All @@ -185,6 +210,7 @@ public class DalamudBuild : NukeBuild
DotNetTasks.DotNetTest(s => s
.SetProjectFile(TestProjectFile)
.SetConfiguration(Configuration)
.AddProperty("WarningLevel", "0")
.EnableNoRestore());
});

Expand Down