CI: every game-free test on every change, workflow hygiene, and the Windows builder attached to releases #695
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!695
Loading…
Reference in a new issue
No description provided.
Delete branch "ci-overhaul-tests-windows"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this does
Three commits, one per topic:
tests/run_all.py).No game data is fetched, built or uploaded anywhere. CI still never compiles the game or its lifted code.
1. Tests
Before: 70 of the 83 test files were listed one step each, each with its own entry in two hand-kept path lists (about 150 paths each).
Now: the Python source checks run on every pull request to
mainand every push tomain, with no path filters. They call one stdlib-only runner:tests/test_*.pyandnx2/test_*.py, so a new test needs no workflow edit. Each one runs in its own process with a timeout, several at once.--no-skipruns them anyway.--strict(used in CI) makes a check fail when its compiler, headers or package is missing, instead of skipping it quietly.--cxx g++,--cc gcc, and so on).Python source checks (ubuntu-24.04)and(windows-2022). So does the SPIR-V global16 job. The steps that aren't plain test files are kept, and they now run even when an earlier step failed:cl.exepresent_rect,test_invalidate_vcore.py --cxx cl);Also checked now:
.pyfile, in memory, so a syntax error anywhere fails.gpu/vk/tests:present_rect_test.cppnow also runs on Linux with-Wall -Wextra -Werror. MSVC still builds it on Windows.lower_test.cppis built and run over an empty folder. The programs it really reads are dumped from the game, so in CI this only shows that the lowering still compiles.The 13 test files no step runs today:
nx2/test_mesh_first_types,nx2/test_texture_init_barrier,nx2/test_default_point_size,nx2/test_coop_spirv,nx2/test_spirv_struct_identity,nx2/test_nup_codec,tests/test_present_semaphores,tests/test_report_wordsnx2/test_draw_parameters: the DrawParameters block it compiles now readsEmitContext::wants_mesh_first, and the test's stand-in context lacked that member (test-only fix)nx2/test_insn,nx2/test_leaf(need the game's modules and Unicorn),nx2/test_dll(needs a full game build),nx2/test_bc_storage_views(needs a Windows Vulkan device)The headers come from pinned checkouts at the versions
scripts/linux/deps.shuses: Vulkan-Headers v1.4.345 and SPIRV-Headers vulkan-sdk-1.4.341.0.zstandard==0.25.0is installed for the two NUP tests.Windows coverage: windows-2022 runs 27 test files today. Nearly all the tests marked Linux-only pass there too, so it now runs 74 of the 83. It skips the 4 above, plus:
test_hookshot_launch: the Linux launcher is a shell script.spirv-val, which only the Linux runner installs.Linux runs 79 of the 83.
Fails on main today:
tests/test_cas_loop_ceiling.py(both OSes).spirv-valreports "All OpVariable instructions in a function must be the first instructions in the first block".Both are now fixed here, in a separate commit (
SPIR-V: compare-exchange loops declare their attempt count first, ...):CONTRIBUTING.mdnow documents the runner.2. Hygiene
linux-appimage.ymlandrelease.ymlused@v4/@v2..github/dependabot.ymlproposes action updates weekly, grouped into one PR.contents: read.contents: writeis granted only to the jobs that push the release commit or attach release assets.3. Windows builder (
windows-builder.yml, windows-2022)A player's download is
HookshotBuilder.exe(the setup) andhookshot-setup.txt, plus the parts that list names in thebuilder-partsrelease. This workflow makes them the way the current package is laid out:builder/setup/setup.cbuilt with the llvm-mingw thatmake_setup_parts.pynames. The zip is SHA-256 checked and cached. The result is the same size, byte for byte, as v2.0.1'sHookshotBuilder.exe. The build line insetup.c's comment gains-municode, because the entry point iswWinMain.dotnet publish -c Release -p:Version=<tag without v>, asdocs/versioning.mdsays. Any other commit getsgit describe's version.scripts/release_parts.py package):LICENSE;gpu,host,nx2andscriptsundertools/;tools/work;tools/third_party: the tracked files, plus the prebuilt files the repository doesn't carry (a64emit.dll,lld-link.exe,SDL2.dll,SDL3.dll,zbic.dll), taken from the latest release's third_party part.a64emit.dllandzbic.dllare rebuilt on the player's PC when their sources' stamps change, as today.make_setup_parts.pysplits the package. Its new--reuseoption takes the Python, emsdk, CPM and wgpu-native parts from the latest release's list, unchanged, since CI can't make those..gitattributessays LF).appimage.shbuilds Linux's (RX_VK_ONLY=1, no lift, no game). Players build it on their PC, so it isn't a release asset. This job only checks that it still builds, and uploadshookshot_vk.dllas an artifact.HookshotBuilder-windows(the setup, the list, the new parts) andhookshot_vk-windows.Releases
On a tag, the Windows
releasejob runs after both Windows jobs pass:builder-partsdoesn't have yet. They are named by SHA, so existing ones are skipped. If the release is missing, it is created as a prerelease that is never latest.HookshotBuilder.exeandhookshot-setup.txtto the tag's release.The AppImage's release step moves into its own job (
needs: appimage) and uses the same script,scripts/release_upload.sh:-rcrule is unchanged: a tag containing-rcis a prerelease and never latest. Any other tag is made latest.The AppImage's play-profile step now uses the same helper. It never reads the release being made: before, the Windows job could create it first, and
releases/latestwould then have pointed at a release with no setup list. A fork with no release falls back to upstream's.release.ymlkeeps semantic-release. Its comments, anddocs/versioning.md, now say that both workflows publish the release. No new secrets are needed:RELEASE_TOKENalready makes the tag start both workflows.Tested on a fork
HookshotBuilder.exeandhookshot-setup.txt, and was made latest.builder-partswas created with the new parts. Every part the list names was fetched and its size and SHA-256 checked.-rctag on the fork. Its release was a prerelease, "latest" stayed on the stable one, and the parts already inbuilder-partswere skipped.The jobs run in parallel, so a pull request's checks finish in about the time of the slowest job.
Notes for the maintainer
Workflow lint (actionlint), and the Windows builder's two jobs.HookshotBuilder.exe/hookshot-setup.txt.builder-partsand its line goes into the next release'shookshot-setup.txt. Until then, CI keeps reusing the previous one.source-regressions.ymlwill conflict with this one. With the runner, they only need to add the test file (and anARGSentry intests/run_all.pyif it takes a compiler argument).A suggestion for later: release-please instead of semantic-release
Not done here. I can do it in a follow-up if you want it.
release-please reads the same Conventional Commits. The difference is that it doesn't release on every push to
main. Instead, it keeps one open release PR that carries:Merging that PR creates the tag and the GitHub release, which start the AppImage and Windows workflows the same way.
release-please-config.json+.release-please-manifest.json) keeps one version for the game, the builder and the AppImage, asdocs/versioning.mdwants.changelog.txtcan stay in Factorio's format through a custom changelog step, orscripts/changelog.pycan be run from the release PR.-rcversions work through its prerelease settings onnext.npm installof release tooling on every push.fix:merged by mistake doesn't publish a release by itself.Independent AMD confirmation for the declaration-order issue covered here: a real compute module fails
VUID-VkShaderModuleCreateInfo-pCode-08737because a function-local variable follows executable instructions.Moving only that declaration to the entry block's declaration list makes both SPIR-V validation and Vulkan pipeline construction pass on an RX 9070 XT. IDs, variable instructions, all other instructions and control flow were retained. Fails on the old code, passes now in this isolated module test.
Test command:
I also compiled the real API4 emitter with only the three declaration moves, reusing the matching backend/IR/sirit objects. Generic shared increment, storage U8, shared U8 and shared U16 each fail
spirv-val --target-env vulkan1.3 --uniform-buffer-standard-layoutbefore the change and each pass afterward (4/4 red, 4/4 green). An independent instruction check confirms two locals, one late declaration before the fix and none afterward in each selected helper. These constructor-path tests generate complete modules; they do not dispatch GPU work.Scope: the AMD result covers pipeline construction only, using an isolated SPIR-V ordering repair. I have not tested the complete PR or its retry-ceiling changes, and this does not verify shader output.
No game data is included.