Repository navigation
CI: run the pin-logic checks without the game on GitHub Actions - #7
Merged
Merged
Conversation
tests/Checks read args[0] right after the 11 PinSet checks, so a run with no arguments died with IndexOutOfRangeException and nothing could run the checks on a machine without Timberborn. With no arguments Checks now runs the game-free checks, prints how many passed and how many game checks were skipped, and exits 0. One or two arguments print the usage and exit 2 instead of crashing. With all three arguments the same 38 checks run as before, and the run fails if the GameChecks constant (27) stops matching the checks that need the game, so the skipped count stays honest when checks are added. Checks.csproj already references no game or package DLLs, and the repo's NuGet.Config clears every package source, so the new workflow pins the .NET 8 SDK it installs (on the runner only) and runs the checks on ubuntu-latest for pull requests and pushes to main that touch source/, tests/, NuGet.Config or the workflow. README says how to run them locally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Review follow-ups. The workflow's paths filter left out root-level build inputs such as global.json or Directory.Build.props, and a filtered job never reports on docs-only pull requests, which would block them if the check is ever made required. The job takes seconds, so it now runs on every pull request and push to main, like the other timbermods test workflows. The GameChecks guard compares only counts, so a check that needs no game files but lands after the argument split would silently stop running in CI. The comment at the split and the guard's failure message now say to keep such checks above the split before updating GameChecks. The README command uses forward slashes so it also works in bash and zsh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 22, 2026
kramsey458
marked this pull request as ready for review
September 22, 2026 16:38
kramsey458
added a commit
that referenced
this pull request
Sep 22, 2026
Keep PWA2's localization checks above the GameChecks count guard and raise GameChecks from 27 to 34. Full run: 45/45; no-argument run: 11 passed, 34 skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kramsey458
added a commit
that referenced
this pull request
Sep 22, 2026
- WorkAreaService constructor: keep PWA1's NavigationDistance parameter, _reach and _planner alongside PWA2's ILoc. - tests/Program.cs: keep the planner checks above the game-free split so CI runs them, and raise GameChecks from 34 to 42. Full run: 74/74; no-argument run: 32 passed, 42 skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kramsey458
added a commit
that referenced
this pull request
Sep 22, 2026
- WorkAreaService constructor: keep PWA4's EntityComponentRegistry and PWA2's ILoc. - tests/Program.cs: move the planting-rule and planner Show checks above the game-free split so CI runs them, and raise GameChecks to 56. Full run: 104/104; no-argument run: 48 passed, 56 skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/Checkscan now run without Timberborn installed. With no arguments it runs the 11 pin-logic (PinSet) checks, reports the 27 game checks as skipped and exits 0. A new GitHub Actions workflow (.github/workflows/tests.yml) runs that mode on a clean Ubuntu runner for every pull request and every push tomain. Whenbuild.ps1passes all three arguments, the full 38 checks still run.The mod DLL, the manifest and the
version-1.1assets are unchanged.build.ps1copiesREADME.mdinto the release zip, so the packaged README gains the same one paragraph on running the checks without the game.Items
CI: Tests without the game (brief section 4.8)
What changed
tests/Program.cs11 checks passed; 27 checks that need the game were skipped (...). Exit code 0.GameChecksconstant (27) and fails the run if they differ, so the "skipped" count stays honest. The comment at the split and the guard's failure message both say that new checks needing no game files must go above the split.tests/Checks.csproj: no change needed. It already references no game or package DLLs: it links onlysource/PinSet.cs, which uses onlySystemnamespaces, and it loads game assemblies by reflection only after the split..github/workflows/tests.yml(new):ubuntu-latestand installs the .NET SDK withactions/setup-dotnet@v6(8.0.x).dotnet new globaljson. The repo'sNuGet.Configclears every package source, so a newer default SDK could not restore the net8.0 targeting pack.dotnet run --project tests/Checks.csproj -c Release.pull_request, pushes tomain, andworkflow_dispatch. There is no paths filter, which matches the other timbermods test workflows.README.md("Build from source"): one paragraph with the forward-slash command, which works in PowerShell, cmd, bash and zsh.Test that proves it: the CI step itself,
dotnet run --project tests/Checks.csproj -c Releasewith no arguments.PASS: New map begins without pinsit throwsUnhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array. at Program.<Main>$(String[] args)and exits non-zero.source/PinSet.csto use default equality. The no-argument run then failed withFAIL: Distinct equal-valued buildings retain separate pins.GameCheckstemporarily set to 26, the full run fails withFAIL: 27 checks ran after the game-free block but GameChecks says 26; move any new check that needs no game files above that block, then set GameChecks to the number that still needs the game.Tests
build.ps1 -GameDir <Timberborn>(build, then Checks with 3 args, then packaging)dotnet run --project tests/Checks.csproj -c Release(no args)git archivecopy, emptyNUGET_PACKAGES, SDK pinned bydotnet new globaljsonGitHub Actions ran this workflow on this PR (run 35725809162,
ubuntu-latest) and it passed. It pinned SDK 8.0.425 and printed11 checks passed; 27 checks that need the game were skipped.Co-op impact
None. No simulation, save format, wire format or Harmony patch changes. Only test tooling, CI and one README paragraph change; no file under
source/orpackaging/is touched. Co-op players do not need to update together for this change.Proposed CHANGELOG lines
None needed for players: the mod itself is unchanged. If you want a developer note:
Merge order with PWA1 (#6) and PWA2 (#8)
PWA1 (
claude/pin-refresh-planner, #6) and PWA2 (claude/localize-ui, #8) both add checks totests/Program.cs, and both conflict with this branch there. Whichever of them merges after this PR must:// The checks above use only the mod's game-free sources .../const int GameChecksblock.PinRefreshPlannerchecks) belongs there, directly after thePinSetchecks.source/PinRefreshPlanner.cslink inChecks.csprojuses onlySystemnamespaces, so CI can compile it.GameChecksto the number the fullbuild.ps1run reports in the guard message. It becomes 34 once PWA2 (PWA2: Localize the work-area panel and clear-button text #8) is in, and 42 once PWA1 (PWA1: re-query only the pins a navigation change can reach #6) is in as well.The count guard fails closed: a stale
GameChecksstopsbuild.ps1with the exact number to set.With all three in, the full run is 74/74: 32 game-free checks and
GameChecks = 42. Suggested order: this PR (#7), then #8, then #6. #6 and #8 also conflict with each other in thesource/WorkAreaService.csconstructor: keep_loc = locand #6's_reachand_planner.Needs in-game / two-player testing
Nothing in game: the mod's code and behavior are unchanged.
build.ps1once and confirm theGameChecksguard passes (see the merge-order section).Review
Two adversarial reviewers approved fd57b44. Lenses: save compatibility and cross-mod interaction; is the test real. Their findings:
GameFreeChecksconstant. It would only catch the mistake if the person resolving the merge set it from intent rather than from the reported number, and it adds another constant to every future merge.GameChecksconstant goes stale when PWA1 or PWA2 merges later (minor). See the merge-order section above.build.ps1after rebasing, and the failure message names the exact value to set.global.jsonandDirectory.Build.*, and docs-only PRs would never report the check. The filter is removed; the job takes seconds.tests/Checks.csproj.🤖 Generated with Claude Code